|
9 | 9 | jobs: |
10 | 10 | release: |
11 | 11 | name: release ${{ matrix.target }} |
12 | | - runs-on: ubuntu-latest |
| 12 | + runs-on: ${{ matrix.os }} |
13 | 13 | strategy: |
14 | 14 | fail-fast: false |
15 | 15 | matrix: |
16 | 16 | include: |
17 | 17 | - target: x86_64-pc-windows-gnu |
| 18 | + os: windows-latest |
18 | 19 | archive: zip |
| 20 | + extension: .exe |
19 | 21 | - target: x86_64-unknown-linux-musl |
20 | | - archive: tar.gz tar.xz tar.zst |
| 22 | + os: ubuntu-22.04 |
| 23 | + archive: zip |
| 24 | + extension: "" |
21 | 25 | - target: aarch64-unknown-linux-musl |
22 | | - archive: tar.gz tar.xz tar.zst |
| 26 | + os: ubuntu-22.04-arm |
| 27 | + archive: zip |
| 28 | + extension: "" |
23 | 29 | - target: x86_64-apple-darwin |
| 30 | + os: macos-13 |
24 | 31 | archive: zip |
| 32 | + extension: "" |
25 | 33 | - target: aarch64-apple-darwin |
| 34 | + os: macos-latest |
26 | 35 | archive: zip |
| 36 | + extension: "" |
27 | 37 |
|
28 | 38 | steps: |
29 | 39 | - uses: actions/checkout@master |
30 | | - - name: Compile and release |
31 | | - uses: rust-build/rust-build.action@v1.4.5 |
32 | | - env: |
33 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
34 | 41 | with: |
35 | | - RUSTTARGET: ${{ matrix.target }} |
36 | | - ARCHIVE_TYPES: ${{ matrix.archive }} |
37 | | - TOOLCHAIN_VERSION: 1.85.0 |
38 | | - - name: Upload artifact |
39 | | - uses: actions/upload-artifact@v4 |
| 42 | + toolchain: 1.85.0 |
| 43 | + - name: Compile |
| 44 | + id: compile |
| 45 | + run: | |
| 46 | + cargo build --release --target ${{ matrix.target }} |
| 47 | + - name: Create zip archive |
| 48 | + id: zip_release |
| 49 | + run: | |
| 50 | + mkdir -p release |
| 51 | + cp target/${{ matrix.target }}/release/moodriver${{ matrix.extension }} release/ |
| 52 | + cd release |
| 53 | + zip -r moodriver-${{ matrix.target }}.zip moodriver${{ matrix.extension }} |
| 54 | + echo "ARCHIVE_PATH=release/moodriver-${{ matrix.target }}.zip" >> $GITHUB_OUTPUT |
| 55 | + - name: Upload to GitHub Release |
| 56 | + uses: softprops/action-gh-release@v1 |
| 57 | + if: startsWith(github.ref, 'refs/tags/') |
40 | 58 | with: |
41 | | - name: moosync |
42 | | - path: | |
43 | | - ${{ steps.compile.outputs.BUILT_ARCHIVE }} |
44 | | - ${{ steps.compile.outputs.BUILT_CHECKSUM }} |
| 59 | + files: ${{ steps.zip_release.outputs.ARCHIVE_PATH }} |
0 commit comments