Merge branch 'use-gitlab-latest-release-link' into 'main'

ci: use gitlab latest release link

See merge request dungeonslayers/ds4!197
This commit is contained in:
Johannes Loher 2022-05-23 05:20:19 +00:00
commit ea942345f5
4 changed files with 34 additions and 27 deletions

View file

@ -5,6 +5,11 @@
image: node:lts
variables:
PACKAGE_NAME: ds4
PACKAGE_TYPE: system
PACKAGE_REGISTRY_URL: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/$PACKAGE_NAME
stages:
- check
- build
@ -63,12 +68,11 @@ build:
- if [[ ! -z ${CI_COMMIT_TAG+x} ]]; then export NODE_ENV=production; fi
script:
- yarn build
- mv dist ds4
cache:
<<: *global_cache
artifacts:
paths:
- ds4
- dist
expire_in: 1 week
publish-artifacts:
@ -78,11 +82,13 @@ publish-artifacts:
- apk update
- apk add zip curl
script: |
zip -r ds4.zip ds4/*
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ds4.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ds4/$CI_COMMIT_TAG/ds4.zip"
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ds4/system.json "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ds4/$CI_COMMIT_TAG/system.json"
cd dist
zip -r ../system.zip .
cd ..
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $PACKAGE_TYPE.zip "$PACKAGE_REGISTRY_URL/$CI_COMMIT_TAG/$PACKAGE_TYPE.zip"
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file dist/$PACKAGE_TYPE.json "$PACKAGE_REGISTRY_URL/$CI_COMMIT_TAG/$PACKAGE_TYPE.json"
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
changelog:
stage: prepare-release
@ -96,12 +102,12 @@ changelog:
paths:
- CHANGELOG.md
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
.release-template: &release-template
stage: release
before_script:
- yarn install
- yarn install --immutable
- apt update
- apt install --yes jq
- REPOSITORY_URL=$(echo "${CI_REPOSITORY_URL}" | sed -e "s|gitlab-ci-token:.*@|${RELEASE_TOKEN}:${RELEASE_TOKEN_SECRET}@|g")
@ -115,14 +121,14 @@ changelog:
script: |
yarn bump-version --release=${RELEASE_TYPE}
RELEASE_VERSION=$(jq -r '.version' < package.json)
git add package.json system.json
git add package.json $PACKAGE_TYPE.json
git --no-pager diff
git commit -m "chore(release): ${RELEASE_VERSION}"
git tag -f ${RELEASE_VERSION}
git tag -f v${RELEASE_VERSION}
git push origin ci-processing:${CI_BUILD_REF_NAME} -o ci.skip
git push origin ${RELEASE_VERSION}
git push origin v${RELEASE_VERSION}
only:
- master
- main
when: manual
release-patch:
@ -146,19 +152,20 @@ release:
script:
- echo 'release job'
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
release:
name: ${CI_COMMIT_TAG:1}
tag_name: $CI_COMMIT_TAG
description: "./CHANGELOG.md"
assets:
links:
- name: "ds4.zip"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ds4/$CI_COMMIT_TAG/ds4.zip"
filepath: /ds4.zip
- name: "$PACKAGE_TYPE.zip"
url: "$PACKAGE_REGISTRY_URL/$CI_COMMIT_TAG/$PACKAGE_TYPE.zip"
filepath: /$PACKAGE_TYPE.zip
link_type: package
- name: "system.json"
url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ds4/$CI_COMMIT_TAG/system.json"
filepath: /system.json
- name: "$PACKAGE_TYPE.json"
url: "$PACKAGE_REGISTRY_URL/$CI_COMMIT_TAG/$PACKAGE_TYPE.json"
filepath: /$PACKAGE_TYPE.json
link_type: other
publish-latest-manifest:
@ -168,17 +175,17 @@ publish-latest-manifest:
- apk update
- apk add zip curl
script: |
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ds4/system.json "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/ds4/latest/system.json"
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file dist/$PACKAGE_TYPE.json "$PACKAGE_REGISTRY_URL/latest/$PACKAGE_TYPE.json"
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
publish-to-foundry-admin:
stage: publish
image: johannesloher/foundry-publish
variables:
FVTT_MANIFEST_PATH: ds4/system.json
FVTT_MANIFEST_PATH: dist/$PACKAGE_TYPE.json
FVTT_MANIFEST_URL: ${CI_PROJECT_URL}/-/releases/${CI_COMMIT_TAG}/downloads/system.json
FVTT_DELETE_OBSOLETE_VERSIONS: "true"
script: foundry-publish
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/'
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'

View file

@ -19,7 +19,7 @@ To install and use the Dungeonslayers 4 system for Foundry Virtual Tabletop,
find it in the list in the **Install System** dialog on the Setup menu of the
application. Alternatively, paste the following Manifest URL in that dialog:
https://git.f3l.de/api/v4/projects/dungeonslayers%2Fds4/packages/generic/ds4/latest/system.json
https://git.f3l.de/dungeonslayers/ds4/-/releases/permalink/latest/downloads/system.json
## Development

View file

@ -100,7 +100,7 @@
"type": "Item"
}
],
"manifest": "https://git.f3l.de/api/v4/projects/dungeonslayers%2Fds4/packages/generic/ds4/latest/system.json",
"manifest": "https://git.f3l.de/dungeonslayers/ds4/-/releases/permalink/latest/downloads/system.json",
"download": "https://git.f3l.de/dungeonslayers/ds4/-/releases/1.14.0/downloads/ds4.zip",
"initiative": "@combatValues.initiative.total",
"gridDistance": 1,

View file

@ -12,8 +12,8 @@ const gitlabURL = "https://git.f3l.de";
const getLicenseURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/LICENSE.md`;
const getReadmeURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/README.md`;
const getChangelogURL = (version) => `${gitlabURL}/${repository}/-/releases/${version}`;
const getDownloadURL = (version) => `${gitlabURL}/${repository}/-/releases/${version}/downloads/ds4.zip`;
const getChangelogURL = (version) => `${gitlabURL}/${repository}/-/releases/v${version}`;
const getDownloadURL = (version) => `${gitlabURL}/${repository}/-/releases/v${version}/downloads/system.zip`;
const manifestPath = "./system.json";