fixed release #3
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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-cli: | |
| name: Build CLI - ${{ matrix.target }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| runner: macos-latest | |
| os: macos | |
| archive: tar.gz | |
| - target: aarch64-apple-darwin | |
| runner: macos-latest | |
| os: macos | |
| archive: tar.gz | |
| - target: x86_64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| os: linux | |
| archive: tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| os: linux | |
| use_cross: true | |
| archive: tar.gz | |
| - target: x86_64-pc-windows-msvc | |
| runner: windows-latest | |
| os: windows | |
| archive: zip | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross | |
| run: cargo install cross --locked | |
| - name: Build CLI | |
| run: | | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build -p inky-cli --release --target ${{ matrix.target }} | |
| else | |
| cargo build -p inky-cli --release --target ${{ matrix.target }} | |
| fi | |
| shell: bash | |
| - name: Package (unix) | |
| if: matrix.os != 'windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../inky-${{ matrix.target }}.tar.gz inky | |
| shell: bash | |
| - name: Package (windows) | |
| if: matrix.os == 'windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| 7z a ../../../inky-${{ matrix.target }}.zip inky.exe | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-${{ matrix.target }} | |
| path: inky-${{ matrix.target }}.${{ matrix.archive }} | |
| build-ffi: | |
| name: Build FFI - ${{ matrix.target }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| runner: macos-latest | |
| os: macos | |
| lib_name: libinky.dylib | |
| - target: aarch64-apple-darwin | |
| runner: macos-latest | |
| os: macos | |
| lib_name: libinky.dylib | |
| - target: x86_64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| os: linux | |
| lib_name: libinky.so | |
| - target: aarch64-unknown-linux-gnu | |
| runner: ubuntu-latest | |
| os: linux | |
| lib_name: libinky.so | |
| use_cross: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross | |
| if: matrix.use_cross | |
| run: cargo install cross --locked | |
| - name: Build FFI | |
| run: | | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build -p inky-ffi --release --target ${{ matrix.target }} | |
| else | |
| cargo build -p inky-ffi --release --target ${{ matrix.target }} | |
| fi | |
| shell: bash | |
| - name: Package | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../libinky-${{ matrix.target }}.tar.gz ${{ matrix.lib_name }} | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ffi-${{ matrix.target }} | |
| path: libinky-${{ matrix.target }}.tar.gz | |
| build-wasm: | |
| name: Build WASM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Build WASM | |
| run: wasm-pack build crates/inky-wasm --target nodejs --out-dir ../../bindings/node | |
| - name: Package | |
| run: tar czf inky-wasm-nodejs.tar.gz -C bindings node | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-nodejs | |
| path: inky-wasm-nodejs.tar.gz | |
| release: | |
| name: Create GitHub Release | |
| needs: [build-cli, build-ffi, build-wasm] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Collect release assets | |
| run: | | |
| mkdir release | |
| find artifacts -type f \( -name '*.tar.gz' -o -name '*.zip' \) -exec cp {} release/ \; | |
| cd release | |
| sha256sum * > SHA256SUMS.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: release/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-crates: | |
| name: Publish to crates.io | |
| needs: [release] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| environment: crates-io | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish inky-core | |
| run: cargo publish -p inky-core | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Publish inky-cli | |
| run: cargo publish -p inky-cli | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |