build #68
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
workflow_dispatch: | |
inputs: | |
production: | |
description: 设置编译的固件型号,空格分隔. | |
default: "MI-R4A" | |
required: false | |
release: | |
description: "是否需要发布到Release? (不发布也可以到Artifacts下载)" | |
default: 'yes' | |
required: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hendrikmuhs/[email protected] | |
with: | |
key: "${{ github.event.inputs.production }}" | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
check-latest: true | |
cache: false | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
check-latest: true | |
- name: Prepare environment | |
run: | | |
sudo apt update | |
sudo apt install libtool-bin gperf python3-docutils autopoint gettext ccache | |
- name: Build firmware | |
run: | | |
make "${{ github.event.inputs.production }}" | |
echo "TAG_ANME=$(date +%Y%m%d)" >> $GITHUB_ENV | |
- name : Upload images to Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.event.inputs.production }}-${{ env.TAG_ANME }} | |
path: trunk/images/*.trx | |
- name: Upload images to Releases | |
uses: ncipollo/release-action@v1 | |
if: ${{ github.event.inputs.release == 'yes' }} | |
with: | |
commit: ${{ github.sha }} | |
tag: ${{ env.TAG_ANME }} | |
artifacts: trunk/images/*.trx | |
allowUpdates: true |