Skip to content

Commit 6a7a723

Browse files
committed
build and upload executables created by PyInstaller
- create release on tag push - build executables by PyInstaller: - extract_otp_secrets_linux_x86_64 (glibc 2.28) - extract_otp_secrets_win_x86_64.exe - extract_otp_secrets_macos_x86_64 (untested) - add --version - build linux executable in docker container - update README - add TOC - improve badges - add PyInstaller section - docker - build BASE_IMAGE as ARG - copy only required files to image - add .alias - build.sh - fix clean - fix generate results - generate TOC
1 parent 445d777 commit 6a7a723

23 files changed

+874
-90
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ name: tests
77

88
on:
99
push:
10+
paths-ignore:
11+
- 'docs/**'
1012
# pull_request:
1113
schedule:
1214
# Run daily on default branch
@@ -29,6 +31,7 @@ jobs:
2931
uses: actions/setup-python@v4
3032
with:
3133
python-version: ${{ matrix.python-version }}
34+
check-latest: false
3235
- name: Install zbar shared lib for QReader (Linux)
3336
if: runner.os == 'Linux'
3437
run: |

.github/workflows/ci_docker.yml

+79-19
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ name: docker
1111
on:
1212
# run it on push to the default repository branch
1313
push:
14+
paths-ignore:
15+
- 'docs/**'
16+
tags-ignore:
17+
- '**'
18+
# branches is needed if tags-ignore is used
19+
branches:
20+
- '**'
1421
schedule:
1522
# Run weekly on default branch
1623
- cron: '47 3 * * 6'
1724

1825
jobs:
19-
# define job to build and publish docker image
20-
build-and-push-docker-image:
26+
build-and-push-docker-debian-image:
2127
name: Build Docker image and push to repositories
2228
# run only when code is compiling and tests are passing
2329
runs-on: ubuntu-latest
@@ -57,40 +63,94 @@ jobs:
5763
username: ${{ github.actor }}
5864
password: ${{ secrets.GHCR_IO_TOKEN }}
5965

60-
- name: "no_qr_reader: Build image and push to Docker Hub and GitHub Container Registry"
61-
id: docker_build_only_txt
62-
uses: docker/build-push-action@v2
66+
- name: "qr_reader: Build image and push to Docker Hub and GitHub Container Registry"
67+
id: docker_build_qr_reader_latest
68+
uses: docker/build-push-action@v3
6369
with:
64-
# relative path to the place where source code with Dockerfile is located
6570
platforms: linux/amd64,linux/arm64
71+
# relative path to the place where source code with Dockerfile is located
72+
# TODO file:, move to docker/
6673
context: .
67-
file: Dockerfile_only_txt
74+
file: Dockerfile
6875
# builder: ${{ steps.buildx.outputs.name }}
6976
# Note: tags has to be all lower-case
77+
pull: true
7078
tags: |
71-
scit0/extract_otp_secrets:latest-only-txt
72-
ghcr.io/scito/extract_otp_secrets:latest-only-txt
79+
scit0/extract_otp_secrets:latest
80+
scit0/extract_otp_secrets:bullseye
81+
ghcr.io/scito/extract_otp_secrets:latest
82+
ghcr.io/scito/extract_otp_secrets:bullseye
7383
# build on feature branches, push only on master branch
7484
push: ${{ github.ref == 'refs/heads/master' }}
75-
build-args: |
76-
RUN_TESTS=true
7785

78-
- name: "qr_reader: Build image and push to Docker Hub and GitHub Container Registry"
79-
id: docker_build_qr_reader
80-
uses: docker/build-push-action@v2
86+
- name: Image digest
87+
# TODO upload digests to assets
88+
run: |
89+
echo "extract_otp_secrets: ${{ steps.docker_build_qr_reader_latest.outputs.digest }}"
90+
91+
build-and-push-docker-alpine-image:
92+
name: Build Docker image and push to repositories
93+
# run only when code is compiling and tests are passing
94+
runs-on: ubuntu-latest
95+
96+
# steps to perform in job
97+
steps:
98+
- name: Checkout code
99+
uses: actions/checkout@v3
100+
101+
# avoid building if there are testing errors
102+
- name: Run smoke test
103+
run: |
104+
sudo apt-get install -y libzbar0
105+
python -m pip install --upgrade pip
106+
pip install -U -r requirements-dev.txt
107+
pip install -U .
108+
pytest
109+
110+
- name: Set up QEMU
111+
uses: docker/setup-qemu-action@v2
112+
113+
# setup Docker build action
114+
- name: Set up Docker Buildx
115+
id: buildx
116+
uses: docker/setup-buildx-action@v2
117+
118+
- name: Login to DockerHub
119+
uses: docker/login-action@v2
120+
with:
121+
username: ${{ secrets.DOCKERHUB_USERNAME }}
122+
password: ${{ secrets.DOCKERHUB_TOKEN }}
123+
124+
- name: Login to Github Packages
125+
uses: docker/login-action@v2
126+
with:
127+
registry: ghcr.io
128+
username: ${{ github.actor }}
129+
password: ${{ secrets.GHCR_IO_TOKEN }}
130+
131+
- name: "only_txt: Build image and push to Docker Hub and GitHub Container Registry"
132+
id: docker_build_only_txt
133+
uses: docker/build-push-action@v3
81134
with:
82-
platforms: linux/amd64,linux/arm64
83135
# relative path to the place where source code with Dockerfile is located
136+
platforms: linux/amd64,linux/arm64
84137
context: .
138+
file: Dockerfile_only_txt
85139
# builder: ${{ steps.buildx.outputs.name }}
86140
# Note: tags has to be all lower-case
141+
pull: true
87142
tags: |
88-
scit0/extract_otp_secrets:latest
89-
ghcr.io/scito/extract_otp_secrets:latest
143+
scit0/extract_otp_secrets:only-txt
144+
scit0/extract_otp_secrets:alpine
145+
ghcr.io/scito/extract_otp_secrets:only-txt
146+
ghcr.io/scito/extract_otp_secrets:alpine
90147
# build on feature branches, push only on master branch
91148
push: ${{ github.ref == 'refs/heads/master' }}
149+
build-args: |
150+
RUN_TESTS=true
151+
92152
93153
- name: Image digest
154+
# TODO upload digests to assets
94155
run: |
95-
echo "extract_otp_secrets: ${{ steps.docker_build_qr_reader.outputs.digest }}"
96-
echo "extract_otp_secrets_only_txt: ${{ steps.docker_build_only_txt.outputs.digest }}"
156+
echo "extract_otp_secrets:only-txt: ${{ steps.docker_build_only_txt.outputs.digest }}"

0 commit comments

Comments
 (0)