Release #4
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: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: bitcell-linux-x86_64 | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact_name: bitcell-macos-x86_64 | |
| - os: macos-14 # Native ARM64 runner | |
| target: aarch64-apple-darwin | |
| artifact_name: bitcell-macos-aarch64 | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: bitcell-windows-x86_64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.target }}-cargo- | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libfontconfig1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev | |
| - name: Build release binaries | |
| run: cargo build --release --target ${{ matrix.target }} -p bitcell-node -p bitcell-admin -p bitcell-wallet -p bitcell-wallet-gui | |
| - name: Create artifact directory | |
| shell: bash | |
| run: mkdir -p artifacts | |
| - name: Copy binaries (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| cp target/${{ matrix.target }}/release/bitcell-node artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-admin artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-wallet artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-wallet-gui artifacts/ | |
| - name: Copy binaries (Windows) | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| cp target/${{ matrix.target }}/release/bitcell-node.exe artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-admin.exe artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-wallet.exe artifacts/ | |
| cp target/${{ matrix.target }}/release/bitcell-wallet-gui.exe artifacts/ | |
| - name: Create archive (Unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| cd artifacts | |
| tar -czvf ../${{ matrix.artifact_name }}.tar.gz * | |
| cd .. | |
| - name: Create archive (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path artifacts/* -DestinationPath ${{ matrix.artifact_name }}.zip | |
| - name: Upload artifact (Unix) | |
| if: runner.os != 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_name }}.tar.gz | |
| retention-days: 7 | |
| - name: Upload artifact (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_name }}.zip | |
| retention-days: 7 | |
| release: | |
| name: Upload Release Assets | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -la artifacts/ | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/bitcell-linux-x86_64/bitcell-linux-x86_64.tar.gz | |
| artifacts/bitcell-macos-x86_64/bitcell-macos-x86_64.tar.gz | |
| artifacts/bitcell-macos-aarch64/bitcell-macos-aarch64.tar.gz | |
| artifacts/bitcell-windows-x86_64/bitcell-windows-x86_64.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |