2023-06-13 01:09:51 +02:00
|
|
|
# SPDX-FileCopyrightText: 2023 Johannes Loher
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
variables:
|
|
|
|
- &node_image node:lts
|
|
|
|
|
|
|
|
when:
|
|
|
|
event: tag
|
|
|
|
evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$"
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- checks
|
|
|
|
|
|
|
|
steps:
|
|
|
|
install:
|
|
|
|
image: *node_image
|
|
|
|
commands:
|
|
|
|
- yarn install --immutable
|
|
|
|
build:
|
|
|
|
image: *node_image
|
|
|
|
environment:
|
|
|
|
NODE_ENV: production
|
|
|
|
commands:
|
|
|
|
- yarn build
|
2023-06-21 20:15:19 +02:00
|
|
|
package:
|
2023-06-13 01:09:51 +02:00
|
|
|
group: prepare-release
|
|
|
|
image: alpine:latest
|
|
|
|
commands:
|
|
|
|
- apk update
|
|
|
|
- apk add zip curl
|
2023-06-21 20:15:19 +02:00
|
|
|
- mv dist ${CI_REPO_NAME}
|
2023-06-13 01:09:51 +02:00
|
|
|
- zip -r ${CI_REPO_NAME}.zip ${CI_REPO_NAME}/*
|
|
|
|
changelog:
|
|
|
|
group: prepare-release
|
|
|
|
image: *node_image
|
|
|
|
commands:
|
|
|
|
- yarn changelog
|
|
|
|
release:
|
2023-06-21 20:15:19 +02:00
|
|
|
image: woodpeckerci/plugin-gitea-release
|
|
|
|
settings:
|
|
|
|
base_url: ${CI_FORGE_URL}
|
|
|
|
title: ${CI_COMMIT_TAG}
|
|
|
|
note: CHANGELOG.md
|
|
|
|
files:
|
|
|
|
- ${CI_REPO_NAME}.zip
|
|
|
|
- ${CI_REPO_NAME}/module.json
|
|
|
|
api_key:
|
|
|
|
from_secret: forge_token
|
|
|
|
publish-latest-manifest:
|
|
|
|
group: publish
|
|
|
|
image: alpine:latest
|
2023-06-13 01:09:51 +02:00
|
|
|
commands:
|
2023-06-21 20:15:19 +02:00
|
|
|
- apk update
|
|
|
|
- apk add curl
|
|
|
|
- export CI_FORGE_API_URL=${CI_FORGE_URL}/api
|
|
|
|
- 'curl --header "Authorization: token $${FORGE_TOKEN}" -X "DELETE" "$${CI_FORGE_API_URL}/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/latest/module.json"'
|
|
|
|
- 'curl --fail --header "Authorization: token $${FORGE_TOKEN}" --upload-file ${CI_REPO_NAME}/module.json "$${CI_FORGE_API_URL}/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/latest/module.json"'
|
2023-06-13 01:09:51 +02:00
|
|
|
secrets:
|
|
|
|
- forge_token
|
|
|
|
publish-to-foundry-admin:
|
2023-06-21 20:15:19 +02:00
|
|
|
group: publish
|
2023-06-13 01:09:51 +02:00
|
|
|
image: johannesloher/foundry-publish
|
|
|
|
environment:
|
|
|
|
FVTT_DELETE_OBSOLETE_VERSIONS: 'true'
|
|
|
|
commands:
|
2023-06-21 20:15:19 +02:00
|
|
|
- export FVTT_MANIFEST_PATH=${CI_REPO_NAME}/module.json
|
|
|
|
- export FVTT_MANIFEST_URL=${CI_REPO_URL}/releases/download/${CI_COMMIT_TAG}/module.json
|
2023-06-13 01:09:51 +02:00
|
|
|
- foundry-publish
|
|
|
|
secrets:
|
|
|
|
- fvtt_package_id
|
|
|
|
- fvtt_username
|
|
|
|
- fvtt_password
|