forked from FaithLife-Community/OuDedetai
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (36 loc) · 1.52 KB
/
build-snap.yml
File metadata and controls
37 lines (36 loc) · 1.52 KB
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
name: Build snap
on:
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt install -y snapd
sudo snap install --classic snapcraft
# It would be ideal to add current user to the lxd group, but that's not easy in GHA
sudo lxd init --auto
sudo chmod -R o+r ${{github.workspace}}
sudo chown -R :lxd ${{github.workspace}}
- name: Patch snapcraft.yaml
run: |
echo We want to build from the current branch not re-pull from git.
sed -i 's#source: https://github.com/FaithLife-Community/OuDedetai.git#source: https://github.com/FaithLife-Community/OuDedetai.git\n source-commit: ${{ github.sha }}#' snap/snapcraft.yaml
sed -zi 's#override-pull: |\n craftctl default\n craftctl set version=$(git describe --tag)#override-pull: |\n craftctl default\n craftctl set version=dev-$(git rev-parse --short HEAD)#' snap/snapcraft.yaml
- name: Debug information
run: |
sudo ls -al ${{github.workspace}}
sudo ls -al ${{github.workspace}}/ou_dedetai/assets
cat snap/snapcraft.yaml
- name: Build snap
working-directory: snap
run: |
sudo snapcraft || (echo "dumping failure log:";sudo bash -c 'cat /root/.local/state/snapcraft/log/*.log'; exit 1)
ls -al
- name: Upload snap
uses: actions/upload-artifact@v4
with:
name: oudedetai-${{ github.sha }}.snap
path: snap/*.snap