Bump to version 1.0.0 (#607) #1
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: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| jobs: | |
| # Check if this is a pre-release version | |
| check-version: | |
| name: Check version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_prerelease: ${{ steps.check.outputs.is_prerelease }} | |
| steps: | |
| - name: Check if pre-release | |
| id: check | |
| run: | | |
| if [[ "${{ github.ref_name }}" =~ -rc\. ]]; then | |
| echo "is_prerelease=true" >> $GITHUB_OUTPUT | |
| echo "This is a pre-release version, skipping publish" | |
| else | |
| echo "is_prerelease=false" >> $GITHUB_OUTPUT | |
| echo "This is a release version, proceeding with publish" | |
| fi | |
| # Phase 1: Publish core | |
| publish-core: | |
| name: Publish reqsign-core | |
| runs-on: ubuntu-latest | |
| needs: check-version | |
| if: needs.check-version.outputs.is_prerelease == 'false' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| cargo publish -p reqsign-core 2>&1 | tee /tmp/publish.log || { | |
| if grep -q "already uploaded" /tmp/publish.log || grep -q "already exists" /tmp/publish.log; then | |
| echo "::warning::reqsign-core version already published, skipping" | |
| exit 0 | |
| else | |
| echo "::error::Failed to publish reqsign-core" | |
| exit 1 | |
| fi | |
| } | |
| # Phase 2: Publish context and service crates (depend on core) | |
| publish-dependencies: | |
| name: Publish ${{ matrix.package }} | |
| runs-on: ubuntu-latest | |
| needs: [check-version, publish-core] | |
| if: needs.check-version.outputs.is_prerelease == 'false' | |
| strategy: | |
| matrix: | |
| package: | |
| - reqsign-command-execute-tokio | |
| - reqsign-http-send-reqwest | |
| - reqsign-file-read-tokio | |
| - reqsign-aliyun-oss | |
| - reqsign-aws-v4 | |
| - reqsign-azure-storage | |
| - reqsign-google | |
| - reqsign-huaweicloud-obs | |
| - reqsign-oracle | |
| - reqsign-tencent-cos | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| cargo publish -p ${{ matrix.package }} 2>&1 | tee /tmp/publish.log || { | |
| if grep -q "already uploaded" /tmp/publish.log || grep -q "already exists" /tmp/publish.log; then | |
| echo "::warning::${{ matrix.package }} version already published, skipping" | |
| exit 0 | |
| else | |
| echo "::error::Failed to publish ${{ matrix.package }}" | |
| exit 1 | |
| fi | |
| } | |
| # Phase 3: Publish main crate (depends on all others) | |
| publish-reqsign: | |
| name: Publish reqsign | |
| runs-on: ubuntu-latest | |
| needs: [check-version, publish-dependencies] | |
| if: needs.check-version.outputs.is_prerelease == 'false' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| cargo publish -p reqsign 2>&1 | tee /tmp/publish.log || { | |
| if grep -q "already uploaded" /tmp/publish.log || grep -q "already exists" /tmp/publish.log; then | |
| echo "::warning::reqsign version already published, skipping" | |
| exit 0 | |
| else | |
| echo "::error::Failed to publish reqsign" | |
| exit 1 | |
| fi | |
| } |