|
37 | 37 | cargo install cargo-get |
38 | 38 | echo "tag_name=v$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT |
39 | 39 |
|
40 | | - release: |
41 | | - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) |
42 | | - needs: prepare |
43 | | - runs-on: ${{ matrix.job.os }} |
44 | | - env: |
45 | | - PLATFORM_NAME: ${{ matrix.job.platform }} |
46 | | - TARGET: ${{ matrix.job.target }} |
47 | | - ARCH: ${{ matrix.job.arch }} |
48 | | - strategy: |
49 | | - matrix: |
50 | | - job: |
51 | | - # The OS is used for the runner |
52 | | - # The platform is a generic platform name |
53 | | - # The target is used by Cargo |
54 | | - # The arch is either 386, arm64 or amd64 |
55 | | - # The svm target platform to use for the binary https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24 |
56 | | - - os: ubuntu-latest-8-cores |
57 | | - platform: linux |
58 | | - target: x86_64-unknown-linux-gnu |
59 | | - arch: amd64 |
60 | | - - os: ubuntu-latest-8-cores-arm64 |
61 | | - platform: linux |
62 | | - target: aarch64-unknown-linux-gnu |
63 | | - arch: arm64 |
64 | | - svm_target_platform: linux-aarch64 |
65 | | - - os: macos-latest-xlarge |
66 | | - platform: darwin |
67 | | - target: x86_64-apple-darwin |
68 | | - arch: amd64 |
69 | | - - os: macos-latest |
70 | | - platform: darwin |
71 | | - target: aarch64-apple-darwin |
72 | | - arch: arm64 |
73 | | - - os: windows-latest |
74 | | - platform: win32 |
75 | | - target: x86_64-pc-windows-msvc |
76 | | - arch: amd64 |
77 | | - |
78 | | - steps: |
79 | | - - uses: actions/checkout@v4 |
80 | | - |
81 | | - - uses: dtolnay/rust-toolchain@master |
82 | | - name: Rust Toolchain Setup |
83 | | - with: |
84 | | - targets: ${{ matrix.job.target }} |
85 | | - toolchain: ${{ env.RUST_VERSION }} |
86 | | - |
87 | | - - uses: Swatinem/rust-cache@v1 |
88 | | - with: |
89 | | - cache-on-failure: true |
90 | | - |
91 | | - - uses: software-mansion/setup-scarb@v1 |
92 | | - with: |
93 | | - scarb-version: "2.13.1" |
94 | | - |
95 | | - - name: Build binaries |
96 | | - run: cargo build --release --locked --bin sozo --target ${{ matrix.job.target }} |
97 | | - |
98 | | - - name: Archive binaries |
99 | | - id: artifacts |
100 | | - env: |
101 | | - VERSION_NAME: ${{ needs.prepare.outputs.tag_name }} |
102 | | - run: | |
103 | | - if [ "$PLATFORM_NAME" == "linux" ]; then |
104 | | - tar -czvf "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release sozo |
105 | | - echo "file_name=dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT |
106 | | - elif [ "$PLATFORM_NAME" == "darwin" ]; then |
107 | | - # We need to use gtar here otherwise the archive is corrupt. |
108 | | - # See: https://github.com/actions/virtual-environments/issues/2619 |
109 | | - gtar -czvf "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release sozo |
110 | | - echo "file_name=dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT |
111 | | - else |
112 | | - cd ./target/${TARGET}/release |
113 | | - 7z a -tzip "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" sozo.exe |
114 | | - mv "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../ |
115 | | - echo "file_name=dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT |
116 | | - fi |
117 | | - shell: bash |
118 | | - |
119 | | - - name: Upload release artifacts |
120 | | - uses: actions/upload-artifact@v4 |
121 | | - with: |
122 | | - name: artifacts-${{ matrix.job.target }} |
123 | | - path: ${{ steps.artifacts.outputs.file_name }} |
124 | | - retention-days: 1 |
125 | | - |
126 | 40 | publish-scarb-packages: |
127 | 41 |
|
128 | 42 | runs-on: ubuntu-latest |
|
0 commit comments