-
Notifications
You must be signed in to change notification settings - Fork 14
53 lines (44 loc) · 1.64 KB
/
tag-and-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
name: tag-and-release
on:
push:
branches:
- main
paths: 'aws-connect'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get version
id: get_version
run: |
version=$(grep "^version=" aws-connect |cut -f2 -d"=")
echo version=$version >> $GITHUB_OUTPUT
echo version_tag=v$version >> $GITHUB_OUTPUT
- name: Tag commit
uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: "${{steps.get_version.outputs.version_tag}}"
- name: Extract from changelog
id: extract_changes
run: |
# Must use a temporary file or it loses the formatting
VERSION=${{steps.get_version.outputs.version}}; awk "/## \[$VERSION\]/{flag=1;next}/## \[/{flag=0}flag" CHANGELOG.md > REL-BODY.md
- name: Create Relase TAR
id: create_tar
run: |
tar cvzf ./aws-connect-${{steps.get_version.outputs.version}}.tar.gz aws-connect* README.md
- name: Generate Checksum
id: generate_checksum
run: |
checksum=$(sha256sum ./aws-connect-${{steps.get_version.outputs.version}}.tar.gz | awk '{print $1}')
echo "${checksum}" > sha256.sum
echo "SHA256: ${checksum}" >> REL-BODY.md
- name: Create Release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
tag: ${{steps.get_version.outputs.version_tag}}
artifacts: "*.gem, CHANGELOG.md, sha256.sum, aws-connect*.tar.gz"
bodyFile: "REL-BODY.md"
token: ${{ secrets.GITHUB_TOKEN }}