Skip to content

Commit

Permalink
[ci] upload snap to snapstore
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Koshura <[email protected]>
  • Loading branch information
AenBleidd committed Feb 20, 2025
1 parent c2abc59 commit 01dbf90
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2023 University of California
# https://boinc.berkeley.edu
# Copyright (C) 2025 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
Expand All @@ -18,12 +18,12 @@
name: Snap
on:
push:
branches: [ master, 'client_release/**' ]
branches: [ master ]
tags: [ 'client_release/**' ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * *'

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

- name: Publish nightly snap build to the edge
if: success() && matrix.type == 'x64' && github.ref == 'refs/heads/master' && github.event_name == 'schedule'
uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }}
with:
snap: ${{ matrix.snap_file }}
release: edge

- name: Publish alpha snap build to the beta
if: success() && matrix.type == 'x64' && startsWith(github.ref, 'refs/tags/')
uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }}
with:
snap: ${{ matrix.snap_file }}
release: beta

- name: Prepare artifacts for deploy
if: success()
run: python ./deploy/prepare_deployment.py linux_snap
Expand Down

0 comments on commit 01dbf90

Please sign in to comment.