Skip to content

Release

Release #320

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_integration_tests:
type: boolean
description: 'Skip integration tests'
default: false
jobs:
version:
name: Compute release version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.dryrun.outputs.release-version }}
tag: ${{ steps.dryrun.outputs.release-channel == 'main' && 'latest' || steps.dryrun.outputs.release-channel }}
permissions:
contents: write
steps:
- name: checkout
uses: actions/checkout@v4
- name: dryrun
id: dryrun
uses: ahmadnassri/action-semantic-release@v2
with:
config: ${{ github.workspace }}/.releaserc.json
dry: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tests:
needs: version
name: Run tests
uses: ./.github/workflows/tests.yaml
secrets: inherit
upload:
needs: [version, tests]
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.skip_integration_tests }}
uses: ./.github/workflows/integration.yaml
secrets: inherit
with:
s3_bucket_prefix: "observeinc-"
release_version: ${{ needs.version.outputs.release_version }}
publish:
needs: [version, integration]
# allow for integration to be skipped
if: always() && !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
if: ${{ needs.version.outputs.tag != '' }}
run: |
make tag
env:
MAKEFLAGS: "-j 4 --output-sync=target"
S3_BUCKET_PREFIX: "observeinc-"
RELEASE_VERSION: "${{ needs.version.outputs.version }}"
TAG: ${{ needs.version.outputs.tag }}
- name: Cut release
id: release
uses: ahmadnassri/action-semantic-release@v2
with:
config: ${{ github.workspace }}/.releaserc.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete older pre-releases
uses: dev-drprasad/delete-older-releases@v0.3.4
with:
keep_latest: 0
delete_tags: true
delete_prerelease_only: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}