Bump version to 0.0.11 #11
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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| validate-tag-version: | |
| name: validate-tag-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate tag matches Cargo version | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| cargo_version="$( | |
| awk ' | |
| /^\[workspace\.package\]/ { in_section=1; next } | |
| /^\[/ { if (in_section) exit } | |
| in_section && $1 == "version" { | |
| gsub(/"/, "", $3) | |
| print $3 | |
| exit | |
| } | |
| ' Cargo.toml | |
| )" | |
| if [[ -z "${cargo_version}" ]]; then | |
| echo "Could not resolve workspace.package.version from Cargo.toml" >&2 | |
| exit 1 | |
| fi | |
| expected_tag="v${cargo_version}" | |
| if [[ "${tag}" != "${expected_tag}" ]]; then | |
| echo "Tag/version mismatch:" >&2 | |
| echo " tag: ${tag}" >&2 | |
| echo " Cargo.toml workspace version: ${cargo_version}" >&2 | |
| echo " expected tag: ${expected_tag}" >&2 | |
| exit 1 | |
| fi | |
| echo "Tag/version check passed: ${tag}" | |
| build: | |
| name: build-${{ matrix.archive_os }}-${{ matrix.archive_arch }} | |
| needs: [validate-tag-version] | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| archive_os: linux | |
| archive_arch: x86_64 | |
| - runner: macos-15-intel | |
| archive_os: darwin | |
| archive_arch: x86_64 | |
| - runner: macos-14 | |
| archive_os: darwin | |
| archive_arch: aarch64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build binaries | |
| run: cargo build --release -p clawform | |
| - name: Package artifacts | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| asset="clawform_${{ matrix.archive_os }}_${{ matrix.archive_arch }}.tar.gz" | |
| mkdir -p dist | |
| cp target/release/clawform dist/clawform | |
| cp target/release/cf dist/cf | |
| chmod +x dist/clawform dist/cf | |
| tar -C dist -czf "$asset" clawform cf | |
| if command -v sha256sum >/dev/null 2>&1; then | |
| sha256sum "$asset" > "${asset}.sha256" | |
| else | |
| shasum -a 256 "$asset" > "${asset}.sha256" | |
| fi | |
| - name: Upload packaged artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-${{ matrix.archive_os }}-${{ matrix.archive_arch }} | |
| path: | | |
| clawform_${{ matrix.archive_os }}_${{ matrix.archive_arch }}.tar.gz | |
| clawform_${{ matrix.archive_os }}_${{ matrix.archive_arch }}.tar.gz.sha256 | |
| if-no-files-found: error | |
| publish: | |
| name: publish-release | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Prepare release files | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| find dist -type f -name "*.tar.gz" -exec cp {} dist/ \; | |
| find dist -type f -name "*.tar.gz.sha256" -print0 \ | |
| | sort -z \ | |
| | xargs -0 cat > dist/SHA256SUMS | |
| ls -lah dist | |
| - name: Detect release type | |
| id: meta | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| if [[ "${tag}" == *-* ]]; then | |
| echo "is_prerelease=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "is_prerelease=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: ${{ steps.meta.outputs.is_prerelease }} | |
| files: | | |
| dist/*.tar.gz | |
| dist/SHA256SUMS |