-
Notifications
You must be signed in to change notification settings - Fork 54
68 lines (55 loc) · 2.13 KB
/
dev_release.yaml
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: Create dev release
on:
push:
branches:
- main
jobs:
build:
name: Create Dev Release
runs-on: ubuntu-latest
env:
DEV_RELEASE: 0.1.0
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Set up Python scripts
run: |
# set up python requirements and scripts on PR branch
python3 -m venv ve1
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd ..
cd scripts && ../ve1/bin/python3 setup.py install && cd ..
- name: Build Binary
id: build-binary
run: make bin
- name: Create tarfile
if: ${{ steps.build-binary.outcome == 'success' }}
id: create-tarfile
run: |
# check if release file only is included in PR
ve1/bin/tar-file --release=${DEV_RELEASE}
- name: Delete previous release and tag
if: ${{ steps.create-tarfile.outcome == 'success' }}
uses: dev-drprasad/[email protected]
with:
delete_release: true # default: false
tag_name: ${{ env.DEV_RELEASE }} # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create the release
id: create_release
if: ${{ always() && steps.create-tarfile.outcome == 'success' }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.DEV_RELEASE }}
body: "Development release created with each merge into the main branch."
files: ${{ steps.create-tarfile.outputs.tarball_full_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}