-
Notifications
You must be signed in to change notification settings - Fork 25
130 lines (110 loc) · 3.72 KB
/
deploy.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
120
121
122
123
124
125
126
127
128
129
130
name: Deploy Release
on:
push:
branches:
- master
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
outputs:
deploy: ${{ steps.git.outputs.deploy }}
steps:
- uses: actions/checkout@v3
- name: Install Python3
run: |
sudo apt install -y python3
- id: git
name: Check Commit Message
run: |
git clone https://github.com/antony-jr/QArchive qarc
cd qarc
git tag > /tmp/tags.txt
cd ..
rm -rf qarc
cat /tmp/tags.txt
result=$(python3 scripts/check.py "$(git log -1 --pretty=%B)" "/tmp/tags.txt")
#TODO: revert this after testing
#echo "deploy=$result" >> $GITHUB_OUTPUT
echo "deploy=v2.2.9" >> $GITHUB_OUTPUT
- id: make_rel
#TODO: change == to != after testing
if: steps.git.outputs.deploy == 'false'
name: Make Relase
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.git.outputs.deploy}}
run: |
git show -s --format="%b" | head -n -2 > body.md
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--notes-file body.md
notify:
runs-on: ubuntu-latest
name: Notify Qt Modules Repository
needs: [windows-msvc]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Trigger
env:
GITHUB_TOKEN: $${{ secrets.QTMODULES_TOKEN }}
run: gh api repos/antony-jr/qtmodules/dispatches --raw-field event_type=qarchive
windows-msvc:
runs-on: windows-2019
needs: check
if: needs.check.outputs.deploy != 'false'
name: windows-msvc-v${{ matrix.toolset }}-${{ matrix.arch }}-qt-${{ matrix.qt_version }}-${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
qt_version: [5.15.2]
arch: [x64, x86]
build_type: [Release, Debug]
toolset: [14.0, 14.2]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: CMake
uses: lukka/get-cmake@latest
- name: MSVC
uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolset }}
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.62.0
- name: Make Output Directory
run: |
mkdir -p ${{github.workspace}}/output/QArchive
mkdir -p ${{github.workspace}}/upload
- name: Build
run: |
set QT_VERSION=${{ matrix.qt_version }}
python3 scripts/write_conan.py
mkdir build
cd build
cmake -DQARCHIVE_QT_VERSION_MAJOR=5 -DQARCHIVE_CONAN_BUILD=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }}
cmake --install . --prefix=${{ github.workspace }}/output/QArchive --config ${{ matrix.build_type }}
cd ..
- name: Check Contents
working-directory: ${{github.workspace}}
run: ls -R ${{ github.workspace }}/output
- name: Zip Files
run: |
cd ${{ github.workspace }}/output/
7z a ${{ github.workspace }}/upload/windows-msvc-v${{ matrix.toolset }}-qt-${{ matrix.qt_version }}-${{ matrix.arch }}-${{ matrix.build_type }}.zip QArchive
- id: upload_rel
name: Upload Asset
working-directory: ${{ github.workspace }}/upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.check.outputs.deploy }}
run: |
gh release upload %TAG% --repo %GITHUB_REPOSITORY% windows-msvc-v${{ matrix.toolset }}-qt-${{ matrix.qt_version }}-${{ matrix.arch }}-${{ matrix.build_type }}.zip