v0.6.1 #8
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: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Tag name to build artifacts for (e.g. v0.2.0) | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: arm64 | |
| runner: macos-14 | |
| target: aarch64-apple-darwin | |
| - arch: x86_64 | |
| runner: macos-13 | |
| target: x86_64-apple-darwin | |
| steps: | |
| - name: Determine tag | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "release" ]; then | |
| echo "value=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ steps.tag.outputs.value }} | |
| fetch-depth: 0 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build binary | |
| run: cargo build --release --target ${{ matrix.target }} --features git2/vendored-libgit2,git2/vendored-openssl | |
| - name: Package artifact | |
| run: | | |
| TAG=${{ steps.tag.outputs.value }} | |
| ARCH=${{ matrix.arch }} | |
| ARTIFACT="rsworktree-${TAG}-macos-${ARCH}.tar.gz" | |
| BIN_DIR="target/${{ matrix.target }}/release" | |
| tar -C "${BIN_DIR}" -czf "${ARTIFACT}" rsworktree | |
| echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT | |
| id: package | |
| - name: Print checksum | |
| run: shasum -a 256 ${{ steps.package.outputs.artifact }} | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.value }} | |
| files: ${{ steps.package.outputs.artifact }} | |
| fail_on_unmatched_files: true | |
| overwrite_files: true |