Skip to content

Commit ecc3330

Browse files
authored
Merge pull request #6073 from BOINC/vko_upload_snap
2 parents 3b8dcb5 + 01dbf90 commit ecc3330

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.github/workflows/snap.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is part of BOINC.
2-
# http://boinc.berkeley.edu
3-
# Copyright (C) 2023 University of California
2+
# https://boinc.berkeley.edu
3+
# Copyright (C) 2025 University of California
44
#
55
# BOINC is free software; you can redistribute it and/or modify it
66
# under the terms of the GNU Lesser General Public License
@@ -18,12 +18,12 @@
1818
name: Snap
1919
on:
2020
push:
21-
branches: [ master, 'client_release/**' ]
21+
branches: [ master ]
2222
tags: [ 'client_release/**' ]
2323
pull_request:
2424
branches: [ master ]
2525
schedule:
26-
- cron: '0 0 * * *'
26+
- cron: '0 0 * * *'
2727

2828
concurrency:
2929
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -64,6 +64,16 @@ jobs:
6464
run: |
6565
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" >> $GITHUB_ENV
6666
67+
- name: Fix version in the snapcraft.yaml
68+
run: |
69+
PKG_VERSION=$(cat version.h | grep BOINC_VERSION_STRING | sed -e 's|#define BOINC_VERSION_STRING||' | jq -r .)
70+
if [[ "x${PKG_VERSION}" == "x" ]]; then
71+
printf "Could not obtain release package version from version.h"
72+
exit 1
73+
fi
74+
PKG_VERSION_FULL="${PKG_VERSION}-${{ github.run_number }}"
75+
sed -i -E "s/(version: \"$PKG_VERSION\")/version: \"$PKG_VERSION_FULL\"/" ${{ github.workspace }}/snap/snapcraft.yaml
76+
6777
- name: Configure docker qemu
6878
if: success()
6979
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25
@@ -120,6 +130,24 @@ jobs:
120130
name: snap_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
121131
path: deploy/logs.7z
122132

133+
- name: Publish nightly snap build to the edge
134+
if: success() && matrix.type == 'x64' && github.ref == 'refs/heads/master' && github.event_name == 'schedule'
135+
uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40
136+
env:
137+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }}
138+
with:
139+
snap: ${{ matrix.snap_file }}
140+
release: edge
141+
142+
- name: Publish alpha snap build to the beta
143+
if: success() && matrix.type == 'x64' && startsWith(github.ref, 'refs/tags/')
144+
uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40
145+
env:
146+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }}
147+
with:
148+
snap: ${{ matrix.snap_file }}
149+
release: beta
150+
123151
- name: Prepare artifacts for deploy
124152
if: success()
125153
run: python ./deploy/prepare_deployment.py linux_snap

0 commit comments

Comments
 (0)