2023-06-29 21:53:50 +02:00
|
|
|
# SPDX-FileCopyrightText: 2023 Johannes Loher
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
$schema: https://raw.githubusercontent.com/woodpecker-ci/woodpecker/master/pipeline/schema/schema.json
|
|
|
|
|
|
|
|
variables:
|
2023-07-22 00:16:14 +02:00
|
|
|
- &node_image node:lts
|
|
|
|
- &enable_pnpm
|
|
|
|
- corepack enable
|
|
|
|
- corepack prepare pnpm@latest --activate
|
2023-06-29 21:53:50 +02:00
|
|
|
|
|
|
|
when:
|
2023-07-22 00:16:14 +02:00
|
|
|
event: manual
|
|
|
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
2023-06-29 21:53:50 +02:00
|
|
|
|
|
|
|
depends_on:
|
2023-07-22 00:16:14 +02:00
|
|
|
- checks
|
2023-06-29 21:53:50 +02:00
|
|
|
|
|
|
|
steps:
|
2023-07-22 00:16:14 +02:00
|
|
|
install:
|
|
|
|
image: *node_image
|
|
|
|
commands:
|
|
|
|
- <<: *enable_pnpm
|
|
|
|
- pnpm install --frozen-lockfile
|
|
|
|
release:
|
|
|
|
image: *node_image
|
|
|
|
commands:
|
|
|
|
- <<: *enable_pnpm
|
|
|
|
- apt-get update
|
|
|
|
- apt-get install --yes jq
|
|
|
|
- export REPOSITORY_URL=$(echo "${CI_REPO_CLONE_URL}" | sed -e "s|://|://$${FORGE_TOKEN_NAME}:$${FORGE_TOKEN}@|g")
|
|
|
|
- git remote set-url origin $${REPOSITORY_URL}
|
|
|
|
- git config user.name woodpecker[bot]
|
|
|
|
- git config user.email woodpecker[bot]@${CI_SYSTEM_HOST}
|
|
|
|
- pnpm bump-version --release=${RELEASE_TYPE}
|
2023-07-22 00:46:19 +02:00
|
|
|
- pnpm exec prettier --write package.json system.json
|
2023-07-22 00:16:14 +02:00
|
|
|
- export RELEASE_VERSION=$(jq -r '.version' < package.json)
|
|
|
|
- git --no-pager diff
|
|
|
|
- git add package.json system.json
|
|
|
|
- 'git commit -m "chore(release): $${RELEASE_VERSION}"'
|
|
|
|
- git tag -f $${RELEASE_VERSION}
|
|
|
|
- git push origin ${CI_COMMIT_BRANCH}
|
|
|
|
- git push origin $${RELEASE_VERSION}
|
|
|
|
secrets:
|
|
|
|
- forge_token_name
|
|
|
|
- forge_token
|