-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (74 loc) · 2.44 KB
/
release-app.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
name: Release - App
on:
workflow_call:
inputs:
publish-envs:
description: 'The environments to publish to, needs to be a json array with names and roles, e.g. `[{name: "Staging", role: "arn:aws:iam::account:role/role-name"}`'
type: string
required: false
default: '[]'
image-name:
description: 'The name of the image to publish'
type: string
default: ${{ vars.IMAGE_NAME }}
aws-region:
description: 'The AWS region to publish to'
type: string
default: ${{ vars.AWS_REGION }}
run-label:
description: 'The run label to use for the actions'
type: string
default: 'ubuntu-latest'
secrets:
RELEASE_PAT:
required: true
outputs:
version:
description: 'The released version'
value: ${{ jobs.update_version.outputs.version }}
permissions:
contents: write
id-token: write
packages: write
jobs:
update_version:
name: Update Version
runs-on: ${{ inputs.run-label }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PRIVATE_SUBMODULE_ACCESS_TOKEN || github.token }}
fetch-depth: 0
# Don't persist the credentials because we are using the token to fetch the
# private submodule and then we are using different token to create a release
persist-credentials: false
- name: Release
id: release
uses: WalletConnect/actions/github/update-rust-version/@2.5.4
with:
token: ${{ secrets.RELEASE_PAT }}
outputs:
version: ${{ steps.release.outputs.version }}
display_version:
name: Version ➠ ${{ needs.update_version.outputs.version }}
needs: [ update_version ]
runs-on: ${{ inputs.run-label }}
steps:
- run: echo "Version = ${{ needs.update_version.outputs.version }}"
publish:
name: Publish ${{ needs.update_version.outputs.version }} ❱❱ ${{ matrix.env.name }}
needs: [ update_version ]
strategy:
fail-fast: false
matrix:
env: ${{ fromJson(inputs.publish-envs) }}
secrets: inherit
uses: ./.github/workflows/build-publish.yml
with:
version: ${{ needs.update_version.outputs.version }}
image-name: ${{ inputs.image-name }}
aws-region: ${{ inputs.aws-region }}
aws-role-arn: ${{ matrix.env.role }}
run-label: ${{ inputs.run-label }}