-
Notifications
You must be signed in to change notification settings - Fork 43
78 lines (75 loc) · 2.5 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (75 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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/release-secrets@release-secrets-v1.2.0
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'
- 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/release-action@v1.14.0
if: ${{ !inputs.dryRun }}
with:
tag: v${{ inputs.releaseVersion }}
body: ${{ inputs.changeLog }}
artifacts: ${{ env.ARTIFACT_DIRECTORY }}/*