-
-
Notifications
You must be signed in to change notification settings - Fork 49
147 lines (118 loc) · 4.3 KB
/
ci-windows.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI Windows
on:
pull_request:
paths-ignore:
- 'doc/**'
- '**.md'
- '**.rst'
- '**.txt'
release:
types: [created]
env:
ALIRE_OS: "windows"
jobs:
build:
name: CI on Windows
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install FSF toolchain
uses: alire-project/alr-install@v1
with:
crates: gnat_native gprbuild
- name: Build alr
run: gprbuild -j0 -p -P alr_env
- name: alr first run to install msys2
run: ./bin/alr --non-interactive help get
- name: install tar from msys2 (Git tar in Actions VM does not seem to work)
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S tar
- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run test script
run: scripts/ci-github.sh
shell: bash
env:
BRANCH: ${{ github.base_ref }}
INDEX: ""
- name: Install alr
run: gprinstall -p -P alr_env --prefix=${{ runner.temp }}/alr_install
- name: Install qt-installer-framework in msys2
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S mingw64/mingw-w64-x86_64-qt-installer-framework
- name: Add msys2 /mingw64/bin to the path (for qt-installer-framework)
run: echo 'C:\Users\runneradmin\.cache\alire\msys64\mingw64\bin' >> $GITHUB_PATH
shell: bash
- name: Install zip in msys2
run: C:\Users\runneradmin\.cache\alire\msys64\usr\bin\pacman --noconfirm -S zip
- name: Add msys2 /usr/bin to the path (for zip)
run: echo 'C:\Users\runneradmin\.cache\alire\msys64\usr\bin' >> $GITHUB_PATH
shell: bash
- name: Run installer build script
run: bash make-alire-installer
shell: bash
working-directory: scripts/installer/
env:
ALR_INSTALL_DIR: ${{ runner.temp }}/alr_install
ALR_INSTALL_OS: ${{ runner.os }}
- name: Upload installer
uses: actions/upload-artifact@main
with:
name: installer-release-package
path: scripts/installer/alire-*.exe
- name: Upload zip archive
uses: actions/upload-artifact@main
with:
name: zip-release-package
path: scripts/installer/alire-*.zip
- name: Upload tar archive
uses: actions/upload-artifact@main
with:
name: tar-release-package
path: scripts/installer/alire-*.tar.xz
- name: Upload logs (if failed)
if: failure()
uses: actions/upload-artifact@master
with:
name: testsuite-log-windows.zip
path: testsuite/out
# Release steps start here. These only run during a release creation.
- name: Retrieve upload URL for the release
if: github.event_name == 'release'
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Rename installer
if: github.event_name == 'release'
run: copy scripts/installer/alire-*.exe scripts/installer/alire-install.exe
- name: Get release version
if: github.event_name == 'release'
id: get_version
uses: battila7/get-version-action@v2
- name: Upload installer asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: scripts/installer/alire-install.exe
asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-installer-x86_64-windows.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Package binaries
if: github.event_name == 'release'
run: zip alr-bin-windows.zip bin/alr.exe LICENSE.txt
- name: Upload binary asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: alr-bin-windows.zip
asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-bin-x86_64-windows.zip
asset_content_type: application/zip