-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (52 loc) · 2.03 KB
/
main.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
name: Version and Deploy
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
NAME: ${{ github.event.repository.name }}
NAME_SHORT: ${{ github.event.repository.name }}
ORG: ${{ github.repository_owner }}
REBRANDLY_API_KEY: ${{ secrets.REBRANDLY_API_KEY }}
LINK_ID: 468cadc01bce4dda9b8a81f7789b0023
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Tools
run: |
pip install tappack
- name: Increment Version
run: |
git config --global user.name 'Frontmatter Actions'
git config --global user.email 'actions@frontmatter.ai'
echo -n ${VERSION} > version
python3 update_version.py ${VERSION}
tappack --module-path module/ --output ./${NAME_SHORT}.tapp
git add version
git add module/${NAME_SHORT}_constants.be
git add README.md
git add ${NAME_SHORT}.tapp
git commit -am "Increment version number to ${VERSION} for release"
git push
git tag -a v${VERSION} -m "Release version ${VERSION}"
git checkout --track origin/release
git rebase master
git push --follow-tags
- name: Release
uses: softprops/action-gh-release@v1
with:
files: hct.tapp
tag_name: v${{ github.event.inputs.version }}
generate_release_notes: true
- name: Update Link
run: |
URL=https://github.com/${ORG}/${NAME}/releases/download/v${VERSION}/${NAME_SHORT}.tapp
DATA="{\"destination\": \"${URL}\"}"
curl --request POST --url https://api.rebrandly.com/v1/links/${LINK_ID} --header 'accept: application/json' --header "apikey: ${REBRANDLY_API_KEY}" --header 'content-type: application/json' --data "$DATA" &> /dev/null