WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 70e254c

Browse files
committed
create tar.gz packages via github actions
1 parent eb13f10 commit 70e254c

File tree

4 files changed

+219
-112
lines changed

4 files changed

+219
-112
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Docker Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
image-tag: ${{ steps.meta.outputs.version }}
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
images: |
22+
${{ secrets.DOCKER_USERNAME }}/ezbookkeeping
23+
tags: |
24+
type=semver,pattern={{version}}
25+
type=semver,pattern={{major}}.{{minor}}
26+
type=raw,value=latest
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
with:
31+
image: tonistiigi/binfmt:qemu-v8.1.5
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Login to DockerHub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKER_USERNAME }}
40+
password: ${{ secrets.DOCKER_PASSWORD }}
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v6
44+
with:
45+
file: Dockerfile
46+
context: .
47+
platforms: |
48+
linux/amd64
49+
linux/arm64/v8
50+
linux/arm/v7
51+
linux/arm/v6
52+
push: true
53+
build-args: |
54+
RELEASE_BUILD=1
55+
BUILD_PIPELINE=1
56+
CHECK_3RD_API=${{ vars.CHECK_3RD_API }}
57+
SKIP_TESTS=${{ vars.SKIP_TESTS }}
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}
60+
61+
upload-artifact:
62+
needs: build-and-push
63+
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
include:
67+
- arch: linux/amd64
68+
arch_alias: linux-amd64
69+
- arch: linux/arm64/v8
70+
arch_alias: linux-arm64
71+
- arch: linux/arm/v7
72+
arch_alias: linux-armv7
73+
- arch: linux/arm/v6
74+
arch_alias: linux-armv6
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
79+
- name: Set up QEMU
80+
uses: docker/setup-qemu-action@v3
81+
with:
82+
image: tonistiigi/binfmt:qemu-v8.1.5
83+
84+
- name: Set up Docker Buildx
85+
uses: docker/setup-buildx-action@v3
86+
87+
- name: Login to DockerHub
88+
uses: docker/login-action@v3
89+
with:
90+
username: ${{ secrets.DOCKER_USERNAME }}
91+
password: ${{ secrets.DOCKER_PASSWORD }}
92+
93+
- name: Pull and save packaged files for ${{ matrix.arch }}
94+
run: |
95+
VERSION=${{ needs.build-and-push.outputs.image-tag }}
96+
IMAGE=${{ secrets.DOCKER_USERNAME }}/ezbookkeeping:${VERSION}
97+
docker pull --platform ${{ matrix.arch }} ${IMAGE}
98+
cid=$(docker create "${IMAGE}")
99+
docker cp ${cid}:/ezbookkeeping ./ezbookkeeping
100+
docker rm ${cid}
101+
cd ezbookkeeping
102+
tar -czf ../ezbookkeeping-v${VERSION}-${{ matrix.arch_alias }}.tar.gz *
103+
cd ..
104+
rm -rf ezbookkeeping
105+
106+
- name: Upload artifact
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: ezbookkeeping-release-package
110+
path: ezbookkeeping-v*.tar.gz
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Docker Snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
image-tag: ${{ steps.meta.outputs.version }}
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
images: |
22+
${{ secrets.DOCKER_USERNAME }}/ezbookkeeping
23+
tags: |
24+
type=raw,value=SNAPSHOT-{{date 'YYYYMMDD'}}.${{ github.run_id }}
25+
type=raw,value=SNAPSHOT-{{date 'YYYYMMDD'}}
26+
type=raw,value=latest-snapshot
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
with:
31+
image: tonistiigi/binfmt:qemu-v8.1.5
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Login to DockerHub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKER_USERNAME }}
40+
password: ${{ secrets.DOCKER_PASSWORD }}
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v6
44+
with:
45+
file: Dockerfile
46+
context: .
47+
platforms: |
48+
linux/amd64
49+
linux/arm64/v8
50+
linux/arm/v7
51+
linux/arm/v6
52+
push: true
53+
build-args: |
54+
BUILD_PIPELINE=1
55+
CHECK_3RD_API=${{ vars.CHECK_3RD_API }}
56+
SKIP_TESTS=${{ vars.SKIP_TESTS }}
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
60+
upload-artifact:
61+
needs: build-and-push
62+
runs-on: ubuntu-latest
63+
strategy:
64+
matrix:
65+
include:
66+
- arch: linux/amd64
67+
arch_alias: linux-amd64
68+
- arch: linux/arm64/v8
69+
arch_alias: linux-arm64
70+
- arch: linux/arm/v7
71+
arch_alias: linux-armv7
72+
- arch: linux/arm/v6
73+
arch_alias: linux-armv6
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Set up QEMU
79+
uses: docker/setup-qemu-action@v3
80+
with:
81+
image: tonistiigi/binfmt:qemu-v8.1.5
82+
83+
- name: Set up Docker Buildx
84+
uses: docker/setup-buildx-action@v3
85+
86+
- name: Login to DockerHub
87+
uses: docker/login-action@v3
88+
with:
89+
username: ${{ secrets.DOCKER_USERNAME }}
90+
password: ${{ secrets.DOCKER_PASSWORD }}
91+
92+
- name: Pull and save packaged files for ${{ matrix.arch }}
93+
run: |
94+
TAG=${{ needs.build-and-push.outputs.image-tag }}
95+
IMAGE=${{ secrets.DOCKER_USERNAME }}/ezbookkeeping:${TAG}
96+
docker pull --platform ${{ matrix.arch }} ${IMAGE}
97+
cid=$(docker create "${IMAGE}")
98+
docker cp ${cid}:/ezbookkeeping ./ezbookkeeping
99+
docker rm ${cid}
100+
cd ezbookkeeping
101+
tar -czf ../ezbookkeeping-dev-${{ github.run_id }}-${{ matrix.arch_alias }}.tar.gz *
102+
cd ..
103+
rm -rf ezbookkeeping
104+
105+
- name: Upload artifact
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: ezbookkeeping-dev-package
109+
path: ezbookkeeping-dev-*.tar.gz

.github/workflows/docker-release.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/docker-snapshot.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)