forked from mmozeiko/pkgi
-
Notifications
You must be signed in to change notification settings - Fork 99
71 lines (70 loc) · 2.13 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
name: build
run-name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install apt dependencies
run: sudo apt-get install -y ninja-build g++-12
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install python dependencies
run: sudo pip3 install poetry==1.3.2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'
- name: Cache Conan packages
id: cache-conan
if: ${{ github.event.ref == 'refs/heads/master' }}
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: ${{ runner.os }}-conan
- run: ci/ci.sh
- name: Upload linux build
uses: actions/upload-artifact@v3
with:
name: pkgj_cli
path: ci/buildhost/pkgj_cli
- name: Upload vita build
uses: actions/upload-artifact@v3
with:
name: pkgj.vpk
path: ci/build/pkgj.vpk
publish:
needs: build
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: last
- name: Remove previous version
run: |
rm *.vpk
refname=${{ github.ref_name }}
echo -n ${refname:1} > version
- uses: actions/download-artifact@v3
with:
name: pkgj.vpk
- uses: svenstaro/upload-release-action@v2
with:
file: pkgj.vpk
release_name: "PKGJ ${{ github.ref_name }}"
prerelease: ${{ contains(github.ref_name, 'beta') }}
- name: Prepare new version
run: |
git config --global user.name "GitHub actions"
git config --global user.email "[email protected]"
mv pkgj.vpk pkgj-${{ github.ref_name }}.vpk
git add -u
git add pkgj-${{ github.ref_name }}.vpk
git commit -m "Push ${{ github.ref_name }}"
- name: Upload new version
if: ${{ !contains(github.ref_name, 'beta') }}
run: git push origin last