mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-13 01:01:47 +08: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:
@@ -13,21 +13,23 @@ jobs:
|
|||||||
build-and-publish:
|
build-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
|
||||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
||||||
|
|
||||||
- name: Install snapcraft
|
- name: Install snapcraft
|
||||||
run: sudo snap install snapcraft --classic
|
run: sudo snap install snapcraft --classic
|
||||||
|
|
||||||
- name: Authenticate snapcraft
|
|
||||||
shell: bash
|
|
||||||
run: snapcraft login --with <(printf '%s' "$SNAPCRAFT_STORE_CREDENTIALS")
|
|
||||||
|
|
||||||
- name: Remote build
|
- 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: |
|
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 \
|
snapcraft remote-build \
|
||||||
--launchpad-accept-public-upload \
|
--launchpad-accept-public-upload \
|
||||||
--build-for=amd64,arm64,armhf
|
--build-for=amd64,arm64,armhf
|
||||||
@@ -36,6 +38,8 @@ jobs:
|
|||||||
run: find . -maxdepth 1 -type f -name '*.snap' -print
|
run: find . -maxdepth 1 -type f -name '*.snap' -print
|
||||||
|
|
||||||
- name: Upload and release snapcraft nightly build
|
- name: Upload and release snapcraft nightly build
|
||||||
|
env:
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user