-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (56 loc) · 1.87 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# .github/workflows/release.yml
name: Release
on:
push:
branches: [main]
permissions:
contents: write
jobs:
build-release:
name: Build artifacts
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build package
run: |
echo "Creating Linux artifact for aarch64"
apt-get update && apt-get install -y zip &&
pip install -r /workspace/requirements.txt &&
pyinstaller --onefile /workspace/src/app.py &&
mkdir -p /workspace/.artie &&
cp -r /workspace/dist/app /workspace/assets /workspace/config.json /workspace/.artie &&
zip -r /workspace/Artie.zip /workspace/.artie /workspace/Artie\ Scraper.sh
- name: Get HEAD commit hash
id: get_commit
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
- name: Upload Artie.zip
uses: actions/upload-artifact@v3
with:
name: Artie
path: Artie.zip
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Artie_$(date +"%Y.%m.%d_%H-%M")"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: Artie.zip
tag_name: ${{ steps.tag.outputs.release_tag }}
release_name: Release ${{ steps.get_commit.outputs.commit_hash }}