-
Notifications
You must be signed in to change notification settings - Fork 38
110 lines (93 loc) · 3.13 KB
/
release.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
107
108
109
110
name: "release-please"
on:
push:
branches:
- "main"
- "backport/*"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases-created: ${{ steps.release.outputs.releases_created }}
fluence-cli-release-created: ${{ steps.release.outputs['cli--release_created'] }}
fluence-cli-tag-name: ${{ steps.release.outputs['cli--tag_name'] }}
steps:
- name: Set release-please config
id: config
run: |
if [[ ${{ github.ref_name }} == main ]]; then echo "config=.github/release-please/config.json" >> $GITHUB_OUTPUT;
elif [[ ${{ github.ref_name }} =~ ^backport/ ]]; then echo "config=.github/release-please/config-backport.json" >> $GITHUB_OUTPUT;
fi
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@v4
with:
target-branch: ${{ github.ref_name }}
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}
command: manifest
config-file: ${{ steps.config.outputs.config }}
manifest-file: .github/release-please/manifest.json
- name: Show output from release-please
if: steps.release.outputs.releases_created
env:
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }}
run: echo "${RELEASE_PLEASE_OUTPUT}" | jq
promote:
needs: release-please
strategy:
fail-fast: false
matrix:
platform:
- linux-x64
- darwin-x64
- darwin-arm64
- win32-x64
name: "fluence-cli"
uses: ./.github/workflows/pack.yml
with:
ref: ${{ github.ref }}
tag: ${{ needs.release-please.outputs.fluence-cli-tag-name || 'null' }}
platform: ${{ matrix.platform }}
upload-to-s3: true
channel: "main"
slack:
if: always()
name: "Notify"
runs-on: ubuntu-latest
needs:
- release-please
permissions:
contents: read
id-token: write
steps:
- uses: lwhiteley/dependent-jobs-result-check@v1
id: status
with:
statuses: failure
dependencies: ${{ toJSON(needs) }}
- name: Log output
run: |
echo "statuses:" "${{ steps.status.outputs.statuses }}"
echo "jobs:" "${{ steps.status.outputs.jobs }}"
echo "found any?:" "${{ steps.status.outputs.found }}"
- name: Import secrets
uses: hashicorp/[email protected]
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/slack/release-please webhook | SLACK_WEBHOOK_URL
- uses: ravsamhq/notify-slack-action@v2
if: steps.status.outputs.found == 'true'
with:
status: "failure"
notification_title: "*{workflow}* has {status_message}"
message_format: "${{ steps.status.outputs.jobs }} {status_message} in <{repo_url}|{repo}>"
footer: "<{run_url}>"