-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (100 loc) · 3.19 KB
/
manual-publish.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Manually Publish Images and Artifacts
on:
workflow_dispatch:
inputs:
dry-run-tmp:
default: true
description: 'dry-run-tmp'
required: false
type: boolean
dry-run:
default: true
description: 'Skip publishing to DockerHub and Homebrew'
required: false
type: boolean
dry-run-gh:
default: true
description: 'Skip publishing to github'
required: false
type: boolean
dry-run-npm:
default: true
description: 'Skip publishing to npm'
required: false
type: boolean
tag:
description: 'Tag to upload binary artifacts to'
required: true
type: string
jobs:
hello-world:
steps:
- uses: ./.github/actions/temp
id: temp
with:
dry-run-tmp: ${{ inputs.dry-run-tmp }}
release-ldcli:
permissions:
id-token: write # Needed to obtain Docker tokens
contents: write # Needed to upload release artifacts
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.publish.outputs.hashes }}
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get Docker token'
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'
- uses: ./.github/actions/publish
id: publish
with:
dry-run: ${{ inputs.dry-run }}
dry-run-gh: ${{ inputs.dry-run-gh }}
token: ${{ secrets.GITHUB_TOKEN }}
homebrew-gh-secret: ${{secrets.HOMEBREW_DEPLOY_KEY}}
tag: ${{ inputs.tag }}
release-ldcli-npm:
runs-on: ubuntu-latest
if: ${{ inputs.dry-run-npm == false }}
needs: ['release-ldcli']
permissions:
actions: read
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Get NPM token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
- id: publish-npm
name: Publish NPM Package
uses: ./.github/actions/publish-npm
with:
dry-run: ${{ inputs.dry-run }}
prerelease: ${{ inputs.prerelease }}
release-ldcli-provenance:
needs: ['release-ldcli']
permissions:
actions: read
id-token: write
contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.release-ldcli.outputs.hashes }}"
upload-assets: true
upload-tag-name: ${{ inputs.tag }}
provenance-name: ${{ format('ldcli_{0}_multiple_provenance.intoto.jsonl', inputs.tag) }}