-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (57 loc) · 1.95 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
name: Build, Release, and Publish
on:
workflow_dispatch:
inputs:
revision:
description: "Git Revision to release"
required: true
release-version:
description: "Specify the version number (overwriting the package.json version)"
required: false
env:
AWS_DEFAULT_REGION: eu-central-1
jobs:
create-release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
outputs:
pc_contracts_cli: ${{ steps.set_filename_vars_and_rename.outputs.pc_contracts_cli }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ github.token }}
ref: ${{ github.event.inputs.revision }}
- name: Acquire AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Set the version
run: |
if [ -z "${{ github.event.inputs.release-version }}" ]; then
VER=$(jq -r ".version" ./offchain/package.json)
echo "VERSION=$VER" >> $GITHUB_ENV
else
echo "VERSION=${{ github.event.inputs.release-version }}" >> $GITHUB_ENV
fi
- name: Download artifact from S3
run: |
aws s3 cp "s3://pcsc-bucket/${{ github.event.inputs.revision }}.zip" ./pc-contracts-cli-v"${{ env.VERSION }}".zip
- name: create changes text
run: |
if test -f ./.changes/"$VERSION".md ; then
cp ./.changes/.md ./release-notes
else
echo "No changie entry for the version specified" > ./release-notes
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ./release-notes
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
files: ./pc-contracts-cli-v${{ env.VERSION }}.zip
name: "v${{ env.VERSION }}"