-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.68 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
---
name: Release
on:
pull_request:
types:
- closed
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Check out code into the directory
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Use pyinstall to create distribution binary
run: pyinstaller -F router_upgrade_bootstrap.py --runtime-tmpdir /opt/netfoundry/
- name: Use pyinstall to create main binary
run: mkdir /opt/netfoundry; pyinstaller -F router_upgrade.py --runtime-tmpdir /opt/netfoundry/
- name: version
run: echo "version=$(./dist/router_upgrade -v)" >> $GITHUB_ENV
id: version
- name: Tar bootstrap
# tar with previous distibuted name for backwards compatibility
run: cd dist; mv router_upgrade_bootstrap zt-upgrade; tar -zcvf router_upgrade_bootstrap.tar.gz zt-upgrade
- name: Tar main script
# tar with previous distibuted name for backwards compatibility
run: cd dist; mv router_upgrade .router_upgrade; tar -zcvf router_upgrade.tar.gz .router_upgrade
- name: release
uses: ncipollo/release-action@v1
id: release
with:
draft: false
prerelease: false
tag: v${{ env.version }}
artifacts: "dist/router_upgrade_bootstrap.tar.gz,dist/router_upgrade.tar.gz"
artifactContentType: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}