0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-07-01 02:54:36 +02:00

build: fix snapcraft release (#38260)

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Lunny Xiao 2026-06-29 14:35:26 -07:00 committed by GitHub
parent 6f2e328c85
commit b34a09be38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,21 +13,23 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install snapcraft
run: sudo snap install snapcraft --classic
- name: Authenticate snapcraft
shell: bash
run: snapcraft login --with <(printf '%s' "$SNAPCRAFT_STORE_CREDENTIALS")
- name: Remote build
# remote-build runs on Launchpad and authenticates via a credentials file,
# not the Snap Store credentials used by upload
shell: bash
env:
LAUNCHPAD_CREDENTIALS: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
run: |
set -euo pipefail
install -d -m 700 "$HOME/.local/share/snapcraft"
printf '%s' "$LAUNCHPAD_CREDENTIALS" > "$HOME/.local/share/snapcraft/launchpad-credentials"
chmod 600 "$HOME/.local/share/snapcraft/launchpad-credentials"
snapcraft remote-build \
--launchpad-accept-public-upload \
--build-for=amd64,arm64,armhf
@ -36,6 +38,8 @@ jobs:
run: find . -maxdepth 1 -type f -name '*.snap' -print
- name: Upload and release snapcraft nightly build
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
set -euo pipefail