chore: test only push #8
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 Finch latest version | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| get-latest-tag: | |
| name: Get the latest release tag | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| timeout-minutes: 2 | |
| outputs: | |
| tag: ${{ steps.latest-tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Get the latest tag' | |
| id: latest-tag | |
| uses: "WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce" # v1.4.0 | |
| upload-release-definition-to-s3: | |
| needs: | |
| - get-latest-tag | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0 | |
| with: | |
| role-to-assume: ${{ secrets.TOOLBOX_TRIGGER_ROLE }} | |
| role-session-name: upload-release-definition-to-s3 | |
| aws-region: ${{ secrets.TOOLBOX_TRIGGER_REGION }} | |
| - name: Create and upload release definition to S3 | |
| run: | | |
| # Extract version without 'v' prefix for filename | |
| VERSION="${{ needs.get-latest-tag.outputs.tag }}" | |
| VERSION_NO_V="${VERSION#v}" | |
| # Create release definition JSON file | |
| cat > "release-def-${VERSION_NO_V}.json" << EOF | |
| { | |
| "tag_name": "${VERSION}", | |
| "assets": [ | |
| { | |
| "name": "Finch-${{ needs.get-latest-tag.outputs.tag }}-aarch64.pkg", | |
| "os": "mac", | |
| "architecture": "aarch64" | |
| }, | |
| { | |
| "name": "Finch-${{ needs.get-latest-tag.outputs.tag }}-x86_64.pkg", | |
| "os": "mac", | |
| "architecture": "x86_64" | |
| } | |
| ] | |
| } | |
| EOF | |
| # Upload to S3 | |
| aws s3 cp "release-def-${VERSION_NO_V}.json" s3://${{ secrets.TOOLBOX_TRIGGER_BUCKET }}/manifest/release-def-${VERSION_NO_V}.json --content-type "application/json" |