-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (43 loc) · 1.66 KB
/
ci.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
on:
push:
jobs:
build-static:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: |
sudo apt -qqy update && sudo apt -qqy install patchelf build-essential python3-pip git zlib1g-dev python3-setuptools python3-venv python3-wheel
git clone https://github.com/pyinstaller/pyinstaller.git
cd pyinstaller/bootloader && CC="gcc -no-pie" python3 waf configure all && cd -
cd pyinstaller && sudo pip3 install . && cd -
sudo pip3 install staticx
- name: Install dependencies
run: python setup.py egg_info && pip3 install -r *.egg-info/requires.txt
- name: Build static binary
run: |
T="$(git describe --exact-match --tags 2> /dev/null | cut -c2-)" bash -c 'echo -n "__version__ = \"${T:-$(git rev-parse HEAD)}\""' > dockersave/_version.py
pyinstaller -F dockersave/cli.py
mv dist/cli dist/dockersave
staticx dist/dockersave dockersave-static
- uses: actions/upload-artifact@v3
with:
name: dockersave-static
path: dockersave-static
upload-release:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
needs: build-static
steps:
- uses: actions/download-artifact@v3
with:
name: dockersave-static
- run: ls -alh
- run: chmod +x dockersave-static && mv dockersave-static dockersave
- run: ./dockersave --version
- name: Publish
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: dockersave