Skip to content

Release

Release #122

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: Perform a dry-run only
required: false
type: boolean
releaseVersion:
description: Next release version
required: true
type: string
changeLog:
description: Pending changelog (for now please escape new lines; will fix)
required: true
type: string
jobs:
release:
permissions:
id-token: 'write'
contents: 'write'
runs-on: ubuntu-latest
env:
LD_RELEASE_VERSION: ${{ inputs.releaseVersion }}
DRY_RUN: ${{ inputs.dryRun || 'false' }}
CHANGELOG_ENTRY: ${{ inputs.changeLog }}
HOMEBREW_GH_TOKEN: ${{ secrets.LAUNCHDARKLY_HOMEBREW_TAP_DEPLOY_KEY }}
ARTIFACT_DIRECTORY: "/tmp/release-artifacts"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: get secrets
uses: launchdarkly/gh-actions/actions/[email protected]
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN, /production/common/releasing/circleci/orb-token= CIRCLECI_CLI_TOKEN, /production/common/releasing/bitbucket/username = BITBUCKET_USERNAME, /production/common/releasing/bitbucket/token = BITBUCKET_TOKEN, /production/common/releasing/ld-find-code-refs/github-release-token = GITHUB_RELEASE_TOKEN'
- name: set release token
run: echo "GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN" >> $GITHUB_ENV
- name: setup access for find-code-references
uses: launchdarkly/gh-actions/actions/ssh-key-by-repo@main
with:
repo_keys_map: |
{
"launchdarkly/find-code-references": ${{ toJSON(secrets.LAUNCHDARKLY_FIND_CODE_REFERENCES_DEPLOY_KEY) }}
}
- name: build
run: |
if [[ $LD_RELEASE_VERSION == v* ]]; then
echo "Remove v prefix from version: $LD_RELEASE_VERSION"
exit 1
fi
make build
- name: prepare release
run: ./scripts/release/prepare-release.sh
- name: publish
run: |
if [[ "$DRY_RUN" = true ]]; then
./scripts/release/publish-dry-run.sh
else
./scripts/release/publish.sh
fi
- name: release details
run: |
git show -p
ls -1a "$ARTIFACT_DIRECTORY"
- name: push to origin
run: ./scripts/release/push-to-origin.sh
- name: create Github release
uses: ncipollo/[email protected]
if: ${{ !inputs.dryRun }}
with:
tag: v${{ inputs.releaseVersion }}
body: ${{ inputs.changeLog }}
artifacts: ${{ env.ARTIFACT_DIRECTORY }}/*