Skip to content

Release

Release #353

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
description: 'Dry run. Compute release version only'
default: false
skip_tests:
type: boolean
description: 'Skip tests.'
default: false
jobs:
version:
name: Compute release version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.dryrun.outputs.new_release_version }}
channel: ${{ steps.dryrun.outputs.new_release_channel }}
permissions:
contents: write
steps:
- name: checkout
uses: actions/checkout@v4
- name: dryrun
id: dryrun
uses: cycjimmy/semantic-release-action@v4
with:
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tests:
needs: version
if: ${{ !inputs.dry_run && !inputs.skip_tests }}
name: Run tests
uses: ./.github/workflows/tests.yaml
secrets: inherit
upload:
needs: [version, tests]
if: always() && !inputs.dry_run && !failure() && !cancelled()
name: Upload SAM assets
uses: ./.github/workflows/upload.yaml
permissions:
id-token: write
secrets: inherit
with:
s3_bucket_prefix: "observeinc-"
global: ${{ needs.version.outputs.version != '' }}
release_version: ${{ needs.version.outputs.version }}
integration:
needs: upload
name: Run integration tests
if: ${{ !inputs.dry_run && !inputs.skip_tests }}
uses: ./.github/workflows/integration.yaml
secrets: inherit
with:
s3_bucket_prefix: "observeinc-"
release_version: ${{ needs.upload.outputs.release_version }}
publish:
name: Publish release
needs: [version, integration]
# always execute after integration, but allow tests to be skipped
if: always() && !inputs.dry_run && !failure() && !cancelled()
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-2
- name: AWS Info
run: aws sts get-caller-identity
- name: Tag release
id: build
run: |
make tag
env:
MAKEFLAGS: "-j 4 --output-sync=target"
S3_BUCKET_PREFIX: "observeinc-"
RELEASE_VERSION: "${{ needs.version.outputs.version }}"
RELEASE_TAG: ${{ needs.version.outputs.channel }}
- name: Cut release
id: release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete older pre-releases
if: steps.release.outputs.new_release_published
uses: dev-drprasad/delete-older-releases@v0.3.4
with:
keep_latest: 1
delete_tags: true
delete_tag_pattern: ${{ steps.release.outputs.release-channel }}
delete_prerelease_only: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}