Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 56 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
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
required: true
type: string
pull_request
# 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
# required: true
# type: string

jobs:
release:
Expand All @@ -23,58 +24,55 @@ jobs:
contents: 'write'
runs-on: ubuntu-latest
env:
LD_RELEASE_VERSION: ${{ inputs.releaseVersion }}
DRY_RUN: ${{ inputs.dryRun || 'false' }}
CHANGELOG_ENTRY: ${{ inputs.changeLog }}
LD_RELEASE_VERSION: 2.14.0
DRY_RUN: true
CHANGELOG_ENTRY: '### Added:\n- `--skipArchivedFlags` option to instruct the tool to ignore any flag keys it finds from archived flags\n\n### Changed:\n- replaced the stdlib `regexp` with `go-re2` for improved regexp compilation and pattern matching\n- now using caching to optimize file globbing and regex compilation\n- move off of legacy `olekukonko/tablewriter` and onto `v1.x`\n- updated to the latest version of the LaunchDarkly API\n\n### Fixed:\n- `subdirectory` option now works with `projects[*].dir` configuration, and produces correct "View in source" links in the LD UI'
# LD_RELEASE_VERSION: ${{ inputs.releaseVersion }}
# DRY_RUN: ${{ inputs.dryRun || 'false' }}
# CHANGELOG_ENTRY: ${{ inputs.changeLog }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_DIRECTORY: "/tmp/release-artifacts"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install jq
run: |
if ! command -v jq >/dev/null; then
sudo apt-get update
sudo apt-get install -y jq
fi
- 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'
- 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
# - 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'
# - 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
# 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
ls -1a "$ARTIFACT_DIRECTORY"
# - name: publish
# run: |
# if [[ "$DRY_RUN" = true ]]; then
# ./scripts/release/publish-dry-run.sh
# else
# ./scripts/release/publish.sh
# fi
# ls -1a "$ARTIFACT_DIRECTORY"
- name: commit changes and tag
run: ./scripts/release/commit-and-tag.sh
- name: create Github release
uses: ncipollo/[email protected]
if: ${{ !inputs.dryRun }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ inputs.releaseVersion }}
body: ${{ inputs.changeLog }}
artifacts: ${{ env.ARTIFACT_DIRECTORY }}/*
# - name: create Github release
# uses: ncipollo/[email protected]
# if: ${{ !inputs.dryRun }}
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag: v${{ inputs.releaseVersion }}
# body: ${{ inputs.changeLog }}
# artifacts: ${{ env.ARTIFACT_DIRECTORY }}/*
3 changes: 2 additions & 1 deletion scripts/release/commit-and-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ tag_exists() (

update_changelog() (
local ts=$(date +"%Y-%m-%d")
local changelog_entry=$(printf "## [%s] - %s\n%s\n" "$LD_RELEASE_VERSION" "$ts" "$CHANGELOG_ENTRY")
local expanded=$(printf "%b", "$CHANGELOG_ENTRY")
local changelog_entry=$(printf "## [%s] - %s\n%s\n" "$LD_RELEASE_VERSION" "$ts" "$expanded")

# insert the new changelog entry (followed by empty line) after line 4
# of CHANGELOG.md
Expand Down
Loading