mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-29 12:09:05 +01:00
ci/cd: show branch-based version in next builds
This commit is contained in:
@@ -59,6 +59,16 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Determine next tag and version
|
||||
run: |
|
||||
if [ "$GITHUB_REF_NAME" = main ]; then
|
||||
echo "BUILD_NEXT=next" >> "$GITHUB_ENV"
|
||||
echo "NEXT_VERSION=v$(cat .version)-next" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "BUILD_NEXT=next-$GITHUB_REF_NAME" >> "$GITHUB_ENV"
|
||||
echo "NEXT_VERSION=$GITHUB_REF_NAME-next" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
|
||||
with:
|
||||
@@ -67,7 +77,6 @@ jobs:
|
||||
args: release --clean --skip=announce,validate --parallelism=4
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BUILD_NEXT: ${{ github.ref_name == 'main' && 'next' || format('next-{0}', github.ref_name) }}
|
||||
SKIP_RELEASE: "true"
|
||||
SKIP_CHANGELOG: "true"
|
||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||
|
||||
+3
-3
@@ -78,7 +78,7 @@ builds:
|
||||
ldflags:
|
||||
- -w -s
|
||||
- -buildid={{ .Version }}
|
||||
- -X github.com/pocket-id/pocket-id/backend/internal/common.Version={{ .Version }}
|
||||
- -X github.com/pocket-id/pocket-id/backend/internal/common.Version={{ .Env.NEXT_VERSION }}
|
||||
flags:
|
||||
- -trimpath
|
||||
- -p=2
|
||||
@@ -193,7 +193,7 @@ dockers_v2:
|
||||
"org.opencontainers.image.url": "https://github.com/pocket-id/pocket-id"
|
||||
"org.opencontainers.image.documentation": "https://github.com/pocket-id/pocket-id/blob/main/README.md"
|
||||
"org.opencontainers.image.source": "https://github.com/pocket-id/pocket-id"
|
||||
"org.opencontainers.image.version": "{{ .Version }}"
|
||||
"org.opencontainers.image.version": "{{ .Env.NEXT_VERSION }}"
|
||||
"org.opencontainers.image.revision": "{{ .FullCommit }}"
|
||||
"org.opencontainers.image.licenses": "BSD-2-Clause"
|
||||
"org.opencontainers.image.ref.name": "pocket-id"
|
||||
@@ -221,7 +221,7 @@ dockers_v2:
|
||||
"org.opencontainers.image.url": "https://github.com/pocket-id/pocket-id"
|
||||
"org.opencontainers.image.documentation": "https://github.com/pocket-id/pocket-id/blob/main/README.md"
|
||||
"org.opencontainers.image.source": "https://github.com/pocket-id/pocket-id"
|
||||
"org.opencontainers.image.version": "{{ .Version }}"
|
||||
"org.opencontainers.image.version": "{{ .Env.NEXT_VERSION }}"
|
||||
"org.opencontainers.image.revision": "{{ .FullCommit }}"
|
||||
"org.opencontainers.image.licenses": "BSD-2-Clause"
|
||||
"org.opencontainers.image.ref.name": "pocket-id"
|
||||
|
||||
@@ -29,7 +29,7 @@ export default defineConfig(() => {
|
||||
precompress: true
|
||||
}),
|
||||
version: {
|
||||
name: packageJson.version,
|
||||
name: process.env.NEXT_VERSION ?? packageJson.version,
|
||||
pollInterval: 0
|
||||
}
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user