forked from rmkit-dev/remarkable_puzzles
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 2.97 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release build and full source archive
on:
push:
branches:
- main
tags:
- v*
jobs:
source:
name: Zip full source with submodules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install git-archive-all
- name: Create full archive
run: git-archive-all -v puzzles-source.tar.gz
- name: Upload source artifact
uses: actions/upload-artifact@v2
with:
name: puzzles-source
path: puzzles-source.tar.gz
build:
name: Release build
runs-on: ubuntu-latest
container: ghcr.io/toltec-dev/python:latest
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install git -y
pip3 install okp
- uses: actions/checkout@v2
with:
submodules: true
- name: Build RM
shell: bash
run: |
if [[ "${GITHUB_REF##*/}" == v* ]]; then
make puzzles ARCH=rm BUILD=release RMP_VERSION=${GITHUB_REF##*/}
else
make puzzles ARCH=rm BUILD=release
fi
- name: Build Kobo
shell: bash
run: |
if [[ "${GITHUB_REF##*/}" == v* ]]; then
FBINK=1 make clean
make puzzles ARCH=kobo BUILD=release RMP_VERSION=${GITHUB_REF##*/}
else
make puzzles ARCH=kobo BUILD=release
fi
- name: Gzip artifact
run: |
mv build/release/puzzles .
tar cvzf puzzles.tar.gz puzzles config/ help/ icons/
release:
name: Create Github release
if: startsWith(github.ref, 'refs/tags/v')
needs: [source, build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Create Github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
- name: Upload source asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: puzzles-source/puzzles-source.tar.gz
asset_name: puzzles-source.tar.gz
asset_content_type: application/gzip
- name: Upload build asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: puzzles/puzzles.tar.gz
asset_name: puzzles.tar.gz
asset_content_type: application/gzip