Skip to content

update snap package #27021

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

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ cpu.out
/.go-licenses

# Snapcraft
/gitea_a*.txt
snap/.snapcraft/
parts/
stage/
Expand Down
11 changes: 6 additions & 5 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |

icon: public/assets/img/logo.png
confinement: strict
base: core18
base: core22
adopt-info: gitea

architectures:
Expand Down Expand Up @@ -44,12 +44,13 @@ parts:
source: .
stage-packages: [ git, sqlite3, openssh-client ]
build-packages: [ git, libpam0g-dev, libsqlite3-dev, build-essential]
build-snaps: [ go, node/18/stable ]
build-snaps: [ go/1.21/stable, node/18/stable ]
build-environment:
- LDFLAGS: ""
override-pull: |
snapcraftctl pull
craftctl default

git config --global --add safe.directory /root/parts/gitea/src
last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
# If the latest tag from the upstream project has not been released to
Expand All @@ -61,8 +62,8 @@ parts:

version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
snapcraftctl set-version "$version"
snapcraftctl set-grade "$grade"
craftctl set version "$version"
craftctl set grade="$grade"

override-build: |
set -x
Expand Down