chore(release): bump version to v0.4.3 #14
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*" | |
| workflow_dispatch: | |
| inputs: | |
| release_version: | |
| description: "Release version (e.g. v1.2.3)" | |
| required: true | |
| create_release: | |
| description: "Create GitHub Release" | |
| required: true | |
| default: "true" | |
| upload_artifacts: | |
| description: "Upload build artifacts" | |
| required: true | |
| default: "true" | |
| env: | |
| BIN_NAME: sendmer | |
| IROH_FORCE_STAGING_RELAYS: "1" | |
| jobs: | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_version: ${{ steps.version.outputs.version }} | |
| upload_url: ${{ steps.release.outputs.upload_url }} | |
| steps: | |
| - name: Determine release version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [ "${GITHUB_EVENT_NAME}" = "push" ]; then | |
| VERSION="${GITHUB_REF#refs/tags/}" | |
| else | |
| VERSION="${{ github.event.inputs.release_version }}" | |
| fi | |
| if [ -z "$VERSION" ]; then | |
| echo "Release version is empty" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Release version: $VERSION" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Create GitHub release | |
| id: release | |
| if: github.event_name == 'push' || github.event.inputs.create_release == 'true' | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.version.outputs.version }} | |
| release_name: ${{ steps.version.outputs.version }} | |
| # ------------------------------------------------------------ | |
| # Job 2: Build & Upload Artifacts (matrix) | |
| # ------------------------------------------------------------ | |
| build-release: | |
| name: Build Release Binaries | |
| needs: create-release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| archive: tar.gz | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| archive: tar.gz | |
| use_cross: true | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| archive: tar.gz | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| archive: tar.gz | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| archive: zip | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Generate Changelog and Create Release | |
| run: npx changelogithub | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross (Linux ARM64) | |
| if: matrix.use_cross == true | |
| run: cargo install cross | |
| - name: Install musl tools | |
| if: runner.os == 'Linux' && contains(matrix.target, 'musl') && matrix.use_cross != true | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Build binary | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build --release --target ${{ matrix.target }} | |
| else | |
| cargo build --release --target ${{ matrix.target }} | |
| fi | |
| - name: Package artifact | |
| shell: bash | |
| run: | | |
| VERSION="${{ needs.create-release.outputs.release_version }}" | |
| NAME="${{ env.BIN_NAME }}-${VERSION}-${{ matrix.target }}" | |
| mkdir "$NAME" | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}.exe" "$NAME/" | |
| powershell Compress-Archive "$NAME/*" "$NAME.zip" | |
| echo "ASSET=$NAME.zip" >> $GITHUB_ENV | |
| else | |
| cp "target/${{ matrix.target }}/release/${{ env.BIN_NAME }}" "$NAME/" | |
| tar czf "$NAME.tar.gz" -C "$NAME" . | |
| echo "ASSET=$NAME.tar.gz" >> $GITHUB_ENV | |
| fi | |
| - name: Upload release asset | |
| if: github.event_name == 'push' || github.event.inputs.upload_artifacts == 'true' | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: ${{ env.ASSET }} | |
| asset_name: ${{ env.ASSET }} | |
| asset_content_type: application/octet-stream |