-
Notifications
You must be signed in to change notification settings - Fork 59
88 lines (77 loc) · 3.19 KB
/
on-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
---
name: Upload runtime and binary to GitHub Release
on:
release:
types:
- released
- prereleased
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: false
jobs:
check-vars-and-secrets:
name: Check vars and secrets
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit
add-runtime-and-binary-to-release:
needs: [check-vars-and-secrets]
name: Add runtime and binary to release
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Call action get-ref-properties
id: get-ref-properties
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v7
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
env:
AWS_REGION: us-east-1
with:
aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Download release runtime from S3 bucket
shell: bash
env:
# yamllint disable-line rule:line-length
S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-production-runtime
S3BUCKET_FILE: aleph-production-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
run: |
aws s3 cp '${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }}' \
'aleph-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz'
- name: Download release binary from S3 bucket
shell: bash
env:
# yamllint disable-line rule:line-length
S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get-ref-properties.outputs.sha }}/aleph-production-node
S3BUCKET_FILE: aleph-production-node-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
run: |
aws s3 cp '${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }}' \
'aleph-node-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz'
- name: Generate release artifacts checksum (SHA256)
uses: jmgilman/actions-generate-checksum@v1
with:
output:
checksums-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz.SHA256.txt
patterns: |
*.tar.gz
- name: Add runtime and binary to the release
uses: softprops/action-gh-release@v2
with:
files: |
checksums-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz.SHA256.txt
aleph-runtime-${{ steps.get-ref-properties.outputs.sha }}.tar.gz
aleph-node-${{ steps.get-ref-properties.outputs.sha }}-linux-amd64.tar.gz
slack:
name: Slack notification
runs-on: ubuntu-20.04
needs: [add-runtime-and-binary-to-release]
if: always()
steps:
- name: Send Slack message
uses: Cardinal-Cryptography/github-actions/slack-notification@v7
with:
notify-on: "always"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}