Workflow file for this run
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - "master" | |
| tags: | |
| - "v*" | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| release: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| file: base65536 | |
| output: base65536-linux.zip | |
| - target: x86_64-pc-windows-gnu | |
| file: base65536.exe | |
| output: base65536-windows.zip | |
| name: release | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/[email protected] | |
| - if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }} | |
| run: | | |
| sudo apt-get install -y gcc-mingw-w64-x86-64 | |
| - name: Get Rust toolchain | |
| id: toolchain | |
| run: | | |
| awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT" | |
| - name: install clippy | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| toolchain: ${{ steps.toolchain.outputs.toolchain }} | |
| targets: x86_64-pc-windows-gnu | |
| - uses: actions-rs/[email protected] | |
| with: | |
| toolchain: stable | |
| target: x86_64-pc-windows-gnu | |
| - name: cache dependencies | |
| uses: Swatinem/[email protected] | |
| - name: clippy check | |
| uses: sksat/[email protected] | |
| with: | |
| reporter: github-check | |
| - name: install cargo-license | |
| run: cargo install cargo-license | |
| - name: unit test | |
| run: | | |
| cargo test --no-run --locked | |
| cargo test | |
| - name: build | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| run: | |
| cargo build --release --target $TARGET | |
| - env: | |
| TARGET: ${{ matrix.target }} | |
| FILE: ${{ matrix.file }} | |
| OUTPUT: ${{ matrix.output }} | |
| run: | | |
| mkdir base65536 | |
| cargo license \ | |
| --authors \ | |
| --do-not-bundle \ | |
| --avoid-dev-deps \ | |
| --avoid-build-deps \ | |
| --filter-platform $TARGET \ | |
| > base65536/CREDITS | |
| VERSION_NAME=${GITHUB_REF##*/} | |
| if [[ $VERSION_NAME == "master" ]]; then | |
| VERSION_NAME=$(git rev-parse --short HEAD) | |
| elif [[ ${VERSION_NAME:0:1} == "v" ]]; then | |
| VERSION_NAME=${VERSION_NAME:1} | |
| fi | |
| echo "$VERSION_NAME" > base65536/VERSION.txt | |
| cp LICENSE README.md base65536/ | |
| cp target/$TARGET/release/$FILE base65536/ | |
| zip -r $OUTPUT base65536 | |
| - name: pre-release | |
| uses: softprops/[email protected] | |
| if: "! startsWith(github.ref, 'refs/tags/')" | |
| with: | |
| tag_name: nightly-${{ github.sha }} | |
| prerelease: true | |
| fail_on_unmatched_files: true | |
| files: | | |
| ${{ matrix.output }} | |
| - name: tagged-release | |
| uses: softprops/[email protected] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| fail_on_unmatched_files: true | |
| files: | | |
| ${{ matrix.output }} |