chore(ci): configure release automation
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# One-time bootstrap for the v0.9.1 tag, whose original tag workflow failed before publishing.
|
||||
when:
|
||||
- event: manual
|
||||
|
||||
steps:
|
||||
publish-v0-9-1:
|
||||
image: node:24-bookworm-slim
|
||||
environment:
|
||||
NPM_TOKEN:
|
||||
from_secret: gitea_package_token
|
||||
commands:
|
||||
- corepack enable
|
||||
- corepack prepare pnpm@11.0.0 --activate
|
||||
- pnpm install --frozen-lockfile
|
||||
- test "$(node -p \"require('./package.json').version\")" = "0.9.1"
|
||||
- git rev-parse --verify refs/tags/v0.9.1
|
||||
- pnpm check
|
||||
- pnpm test
|
||||
- pnpm build
|
||||
- npm config set @mifi:registry https://git.mifi.dev/api/packages/mifi/npm/
|
||||
- npm config set -- //git.mifi.dev/api/packages/mifi/npm/:_authToken "$NPM_TOKEN"
|
||||
- pnpm publish --no-git-checks
|
||||
|
||||
notify-bootstrap-failure:
|
||||
image: curlimages/curl:8.14.1
|
||||
depends_on: [publish-v0-9-1]
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package bootstrap failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL"
|
||||
when:
|
||||
- status: [failure]
|
||||
|
||||
notify-bootstrap-success:
|
||||
image: curlimages/curl:8.14.1
|
||||
depends_on: [publish-v0-9-1]
|
||||
environment:
|
||||
MATTERMOST_BOT_ACCESS_TOKEN:
|
||||
from_secret: mattermost_bot_access_token
|
||||
MATTERMOST_CHANNEL_ID:
|
||||
from_secret: mattermost_pushes_channel_id
|
||||
MATTERMOST_POST_API_URL:
|
||||
from_secret: mattermost_post_api_url
|
||||
commands:
|
||||
- |
|
||||
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Package bootstrap success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
|
||||
curl --fail --show-error --silent --request POST --header 'Content-Type: application/json' --header "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" --data "$BODY" "$MATTERMOST_POST_API_URL"
|
||||
when:
|
||||
- status: [success]
|
||||
@@ -7,13 +7,18 @@ depends_on:
|
||||
- ci
|
||||
|
||||
clone:
|
||||
git:
|
||||
image: woodpeckerci/plugin-git
|
||||
settings:
|
||||
depth: 0
|
||||
partial: false
|
||||
tags: true
|
||||
|
||||
steps:
|
||||
release:
|
||||
image: node:24-bookworm-slim
|
||||
environment:
|
||||
GITEA_PACKAGE_TOKEN:
|
||||
NPM_TOKEN:
|
||||
from_secret: gitea_package_token
|
||||
GITEA_REGISTRY_USERNAME:
|
||||
from_secret: gitea_registry_username
|
||||
@@ -27,7 +32,7 @@ steps:
|
||||
- git config user.email "woodpecker-ci@mifi.dev"
|
||||
- git remote set-url origin "https://${GITEA_REGISTRY_USERNAME}:${GITEA_RELEASE_TOKEN}@git.mifi.dev/mifi/logger.git"
|
||||
- npm config set @mifi:registry https://git.mifi.dev/api/packages/mifi/npm/
|
||||
- npm config set -- //git.mifi.dev/api/packages/mifi/npm/:_authToken "$GITEA_PACKAGE_TOKEN"
|
||||
- npm config set -- //git.mifi.dev/api/packages/mifi/npm/:_authToken "$NPM_TOKEN"
|
||||
- pnpm release
|
||||
|
||||
notify-release-failure:
|
||||
|
||||
@@ -39,3 +39,5 @@ Woodpecker verifies pull requests and `main`, reports CI to Mattermost, then aut
|
||||
Use `fix:` for a patch, `feat:` for a minor release, and `!` or a `BREAKING CHANGE:` footer for a major release. Commits such as `docs:`, `test:`, and `chore:` do not release a package. Before enabling the automation, publish and tag the existing `v0.9.1` once as its baseline.
|
||||
|
||||
The release workflow uses the existing global `gitea_package_token`, `gitea_registry_username`, `gitea_release_token`, `mattermost_bot_access_token`, `mattermost_tests_channel_id`, `mattermost_pushes_channel_id`, and `mattermost_post_api_url` secrets.
|
||||
|
||||
The repository includes a guarded, one-time manual bootstrap workflow for `v0.9.1`; remove it after that initial package version has been published.
|
||||
|
||||
Reference in New Issue
Block a user