release-runtime #264
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-runtime | |
| on: | |
| # push: | |
| # branches: [main] | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["verification"] | |
| types: [completed] | |
| branches: [main] | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| contents: write # This is required for actions/checkout/release | |
| jobs: | |
| release-runtime: | |
| runs-on: ubuntu-latest | |
| # if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[release]')}} | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # - name: Restore cached packages | |
| # id: restore-cached-packages | |
| # uses: actions/cache/restore@v4 | |
| # with: | |
| # path: | | |
| # /home/runner/.cache | |
| # key: ${{ runner.os }}-docker-build-${{ hashFiles('*/deno.lock') }} | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.8.1 | |
| cache: true | |
| - uses: actions/setup-node@v6 | |
| - name: commit-rev-count | |
| run: | | |
| gh api graphql -f query='query CommitRevCount{ | |
| repository(owner:"${{ github.repository_owner }}",name:"${{ github.event.repository.name }}") { | |
| name | |
| object(oid: "${{ github.sha }}"){ | |
| ... on Commit { | |
| message | |
| id | |
| history(first: 0) { | |
| totalCount | |
| } | |
| } | |
| } | |
| } | |
| }' > commit_rev_count_data.json | |
| COMMIT_REV_COUNT="$(jq -r '.data.repository.object.history.totalCount' commit_rev_count_data.json)" | |
| echo "COMMIT_REV_COUNT=$COMMIT_REV_COUNT" >> $GITHUB_ENV | |
| echo "COMMIT_REV_COUNT=$COMMIT_REV_COUNT" | |
| rm commit_rev_count_data.json | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Docker release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 313225491971.dkr.ecr.eu-west-1.amazonaws.com | |
| # aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/f2v6q7q7 | |
| cd tasks | |
| echo "::group::Install multiarch support" | |
| docker run --privileged --rm tonistiigi/binfmt --install linux/arm64 | |
| echo "::endgroup::" | |
| echo "::group::Prepare Build" | |
| deno task prepare-build | |
| echo "::endgroup::" | |
| deno task docker-build | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| aws-region: us-east-1 | |
| role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }} | |
| # - name: Login to Amazon ECR | |
| # id: login-ecr | |
| # uses: aws-actions/amazon-ecr-login@v2 | |
| # with: | |
| # registry-type: public | |
| - name: Cli release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 313225491971.dkr.ecr.eu-west-1.amazonaws.com | |
| # aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/f2v6q7q7 | |
| cd tasks | |
| echo "::group::Publish cli" | |
| deno task cli-publish | |
| echo "::endgroup::" | |
| RELEASE_VERSION="$(jq -r '.release' ../.versions.json)" | |
| echo "### Release Version" >> $GITHUB_STEP_SUMMARY | |
| echo "$RELEASE_VERSION" >> $GITHUB_STEP_SUMMARY |