-
Notifications
You must be signed in to change notification settings - Fork 195
119 lines (105 loc) · 4.62 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
115
116
117
118
119
name: CI Build
on: [push]
jobs:
build:
name: MinGW build
runs-on: ubuntu-latest
container:
image: fedora:rawhide
options: --security-opt seccomp=unconfined
steps:
- name: Set safe directory
run: |
dnf install -y git
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- uses: actions/checkout@v3.3.0
- name: Update system
run: dnf -y update
- name: Install build dependencies
run: ./packaging/win32/mingwdeps.sh
- name: Version number
id: version_number
run: |
if [ ${{ startsWith(github.ref, 'refs/tags/') }} = true ]; then
VERSION=$(basename ${{ github.ref }})
else
VERSION=ci-latest-$(basename ${{ github.ref }})
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Build application
run: |
./packaging/win32/makeinstaller.sh i686 qt5 nodebug ${{ steps.version_number.outputs.version }}
./packaging/win32/makeinstaller.sh x86_64 qt5 nodebug ${{ steps.version_number.outputs.version }}
./packaging/win32/makeinstaller.sh x86_64 gtk nodebug ${{ steps.version_number.outputs.version }}
- name: Reset ci-latest tag
run: |
VERSION=${{ steps.version_number.outputs.version }}
git config --global user.email "ci@github.com"
git config --global user.name "Github CI"
# Workaround for "could not read Username for 'https://github.com': No such device or address"
git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git tag -d $VERSION || true
git push origin :$VERSION || true
git tag -m $VERSION $VERSION
git push --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(steps.version_number.outputs.version, 'ci-latest-')
- name: Create release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version_number.outputs.version }}
release_name: CI Build
draft: false
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload qt5 i686 portable zip release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw32-qt5/gImageReader_${{ steps.version_number.outputs.version }}_qt5_i686_portable.zip
asset_name: gImageReader_latest_qt5_i686_portable.zip
overwrite: true
- name: Upload qt5 i686 installer release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw32-qt5/gImageReader_${{ steps.version_number.outputs.version }}_qt5_i686.exe
asset_name: gImageReader_latest_qt5_i686.exe
overwrite: true
- name: Upload qt5 x86_64 portable zip release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw64-qt5/gImageReader_${{ steps.version_number.outputs.version }}_qt5_x86_64_portable.zip
asset_name: gImageReader_latest_qt5_x86_64_portable.zip
overwrite: true
- name: Upload qt5 x86_64 installer release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw64-qt5/gImageReader_${{ steps.version_number.outputs.version }}_qt5_x86_64.exe
asset_name: gImageReader_latest_qt5_x86_64.exe
overwrite: true
- name: Upload gtk x86_64 portable zip release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw64-gtk/gImageReader_${{ steps.version_number.outputs.version }}_gtk_x86_64_portable.zip
asset_name: gImageReader_latest_gtk_x86_64_portable.zip
overwrite: true
- name: Upload gtk x86_64 installer release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./build/mingw64-gtk/gImageReader_${{ steps.version_number.outputs.version }}_gtk_x86_64.exe
asset_name: gImageReader_latest_gtk_x86_64.exe
overwrite: true