Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] upload snap to snapstore #6073

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 .)
Copy link
Preview

Copilot AI Feb 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of 'jq' here is incorrect as it is typically used for JSON parsing. It should be removed from the command.

Suggested change
PKG_VERSION=$(cat version.h | grep BOINC_VERSION_STRING | sed -e 's|#define BOINC_VERSION_STRING||' | jq -r .)
PKG_VERSION=$(cat version.h | grep BOINC_VERSION_STRING | sed -e 's|#define BOINC_VERSION_STRING||' | tr -d '[:space:]')

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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
Loading