Skip to content

Commit 634a0cc

Browse files
authored
Separate AppImage to own workflow (#1475)
1 parent 524ef2e commit 634a0cc

File tree

4 files changed

+118
-40
lines changed

4 files changed

+118
-40
lines changed

.github/workflows/ci-appimage.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: CI AppImage
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'doc/**'
7+
- '**.md'
8+
- '**.rst'
9+
- '**.txt'
10+
release:
11+
types: [published]
12+
workflow_dispatch:
13+
14+
jobs:
15+
16+
build:
17+
name: AppImage preparation for Linux
18+
19+
# Oldest supported by Alire+GitHub to increase AppImage back-compatibility
20+
# Unfortunately we depend on the static elaboration model of recent GNATs
21+
runs-on: ubuntu-22.04
22+
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v2
26+
with:
27+
submodules: true
28+
29+
- name: Install FSF toolchain
30+
run: sudo apt-get install -y gnat gprbuild
31+
32+
- name: Install Python 3.x (required for the testsuite)
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: '3.x'
36+
37+
- name: Run test script
38+
run: scripts/ci-github.sh
39+
shell: bash
40+
env:
41+
BRANCH: ${{ github.base_ref }}
42+
INDEX: ""
43+
44+
- name: Upload logs (if failed)
45+
if: failure()
46+
uses: actions/upload-artifact@master
47+
with:
48+
name: e3-log-linux.zip
49+
path: testsuite/out
50+
51+
- name: Retrieve upload URL for the release
52+
if: (github.event_name == 'release')
53+
id: get_release
54+
uses: bruceadams/get-release@v1.3.2
55+
env:
56+
GITHUB_TOKEN: ${{ github.token }}
57+
58+
- name: Get release version
59+
if: (github.event_name == 'release')
60+
id: get_version
61+
uses: battila7/get-version-action@v2
62+
63+
- name: Get ref version
64+
if: (github.event_name != 'release')
65+
id: get_ref
66+
run: echo "::set-output name=short_sha::$(echo ${{ github.sha }} | cut -c1-8)"
67+
68+
############
69+
# AppImage #
70+
############
71+
72+
- name: Install AppImage dependencies (libfuse2)
73+
shell: bash
74+
run: |
75+
sudo add-apt-repository universe
76+
sudo apt-get install -y libfuse2
77+
78+
- name: Install AppImage's linuxdeploy
79+
uses: miurahr/install-linuxdeploy-action@v1
80+
with:
81+
plugins: appimage
82+
83+
- name: Copy license into AppImage
84+
run: |
85+
mkdir -p AppDir
86+
cp LICENSE.txt AppDir/
87+
88+
- name: Create AppImage
89+
run: >
90+
linuxdeploy-x86_64.AppImage --appdir AppDir -e bin/alr
91+
-d resources/alr.desktop -i resources/alr.png --output appimage
92+
93+
- name: Rename AppImage
94+
run: mv alr*AppImage alr.AppImage
95+
96+
- name: Upload AppImage asset
97+
if: (github.event_name == 'release')
98+
uses: actions/upload-release-asset@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
with:
102+
upload_url: ${{ steps.get_release.outputs.upload_url }}
103+
asset_path: alr.AppImage
104+
asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-x86_64.AppImage
105+
asset_content_type: application/x-elf
106+
107+
# When not a release we upload as a plain artifact, just to make sure that
108+
# this works as expected. Also this way the AppImage is available for
109+
# regular PRs for easy testing.
110+
- name: Upload as artifact (when not a release)
111+
if: (github.event_name != 'release')
112+
uses: actions/upload-artifact@v2
113+
with:
114+
name: alr-${{ steps.get_ref.outputs.short_sha }}-x86_64.AppImage.zip
115+
path: alr.AppImage

.github/workflows/ci-linux.yml

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: Retrieve upload URL for the release
7272
if: (github.event_name == 'release')
7373
id: get_release
74-
uses: bruceadams/get-release@v1.2.1
74+
uses: bruceadams/get-release@v1.3.2
7575
env:
7676
GITHUB_TOKEN: ${{ github.token }}
7777

@@ -90,40 +90,3 @@ jobs:
9090
asset_path: alr-bin-linux.zip
9191
asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-bin-x86_64-linux.zip
9292
asset_content_type: application/zip
93-
94-
############
95-
# AppImage #
96-
############
97-
98-
- name: Install AppImage's linuxdeploy
99-
if: (github.event_name == 'release')
100-
uses: miurahr/install-linuxdeploy-action@v1
101-
with:
102-
plugins: appimage
103-
104-
- name: Copy license into AppImage
105-
if: (github.event_name == 'release')
106-
run: |
107-
mkdir -p AppDir
108-
cp LICENSE.txt AppDir/
109-
110-
- name: Create AppImage
111-
if: (github.event_name == 'release')
112-
run: >
113-
linuxdeploy-x86_64.AppImage --appdir AppDir -e bin/alr
114-
-d resources/alr.desktop -i resources/alr.png --output appimage
115-
116-
- name: Rename AppImage
117-
if: (github.event_name == 'release')
118-
run: mv alr*AppImage alr.AppImage
119-
120-
- name: Upload AppImage asset
121-
if: (github.event_name == 'release')
122-
uses: actions/upload-release-asset@v1
123-
env:
124-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125-
with:
126-
upload_url: ${{ steps.get_release.outputs.upload_url }}
127-
asset_path: alr.AppImage
128-
asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-x86_64.AppImage
129-
asset_content_type: application/x-elf

.github/workflows/ci-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Retrieve upload URL for the release
6262
if: github.event_name == 'release'
6363
id: get_release
64-
uses: bruceadams/get-release@v1.2.1
64+
uses: bruceadams/get-release@v1.3.2
6565
env:
6666
GITHUB_TOKEN: ${{ github.token }}
6767

.github/workflows/ci-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- name: Retrieve upload URL for the release
109109
if: github.event_name == 'release'
110110
id: get_release
111-
uses: bruceadams/get-release@v1.2.1
111+
uses: bruceadams/get-release@v1.3.2
112112
env:
113113
GITHUB_TOKEN: ${{ github.token }}
114114

0 commit comments

Comments
 (0)