-
Notifications
You must be signed in to change notification settings - Fork 13
121 lines (110 loc) · 4.6 KB
/
publish-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
111
112
113
114
115
116
117
118
119
120
121
name: Publish release
on:
workflow_dispatch:
inputs:
release-name:
description: "Release to create"
required: true
tag:
description: "Tag to create"
required: true
priority:
description: "Priority of the release"
required: false
default: "HIGH"
message:
description: "Additional message for the release"
required: true
default: "New release - upgrade as soon as possible."
pre-release:
description: "Whether to publish pre-release"
required: true
default: true
push-notification:
description: "Whether to push notifications for channels"
required: true
default: false
binary-release-id:
description: "Optional workflow run ID for binaries from which to pull artifacts"
required: false
default: false
runtime-release-id:
description: "Optional workflow run ID for runtimes from which to pull artifacts"
required: false
default: false
jobs:
on-success:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download binary artifact
uses: dawidd6/action-download-artifact@v2
with:
branch: master
workflow: binary-build.yml
workflow_conclusion: success
run_id: ${{ github.event.inputs.binary-release-id }}
- name: Download runtime artifact
uses: dawidd6/action-download-artifact@v2
with:
branch: master
workflow: runtime-build.yml
workflow_conclusion: success
run_id: ${{ github.event.inputs.runtime-release-id }}
- name: Display structure of downloaded files
run: ls -R
- name: Create checksums file
run: |
find . -type f -name "opportunity-standalone-*" -exec sha256sum {} \; >> SHA256CHECKSUMS
find . -type f -name "opportunity_runtime.compact.wasm" -exec sha256sum {} \; >> SHA256CHECKSUMS
find . -type f -name "standard-collator-*" -exec sha256sum {} \; >> SHA256CHECKSUMS
find . -type f -name "standard_runtime.compact.wasm" -exec sha256sum {} \; >> SHA256CHECKSUMS
- name: Archive runtime outputs
run: |
tar -cvzf runtime_build.tar.gz opportunity-runtime-* standard-runtime-*
- name: Build Changelog
id: build-changelog
uses: mikepenz/[email protected]
if: github.ref == 'refs/heads/master'
with:
configuration: ".github/release_notes_config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: ncipollo/[email protected]
id: release-step
if: github.ref == 'refs/heads/master'
with:
artifacts: "SHA256CHECKSUMS, runtime_build.tar.gz, standard-substrate-*/*, opportunity-runtime-*/**/opportunity_runtime.compact.wasm, standard-runtime-*/**/standard_runtime.compact.wasm"
allowUpdates: true
artifactErrorsFailBuild: true
name: ${{ github.event.inputs.release-name }}
tag: ${{ github.event.inputs.tag }}
commit: ${{ github.sha }}
body: ${{ steps.build-changelog.outputs.changelog }}
token: ${{ secrets.BOT_GITHUB_TOKEN }}
prerelease: ${{ github.event.inputs.pre-release == 'true' && 'true' || 'false' }}
- name: Public Discord notification
uses: Ilshidur/[email protected]
if: ${{ github.event.inputs.pre-release == 'false' && github.event.inputs.push-notification == 'true' }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: |
"<@&808602414138654752> - New release in ${{ github.repository }} - **${{ github.event.inputs.release-name }}**.
Priority: **${{ github.event.inputs.priority }}**
Information: ${{ github.event.inputs.message }}
Link: ${{ steps.release-step.outputs.html_url }}"
- name: Internal Slack Notification
uses: bryannice/[email protected]
if: ${{ github.event.inputs.pre-release == 'false' && github.event.inputs.push-notification == 'true' }}
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: "Details: ${{ steps.release-step.outputs.html_url }}"
SLACK_TITLE: "New release in ${{ github.repository }} - ${{ github.event.inputs.release-name }}"
SLACK_COLOR: "#008000"
SLACK_CHANNEL: "github-releases"
SLACK_USERNAME: "Standard Tech Bot"