Skip to content

Commit d93d296

Browse files
committed
ci: release workflow
1 parent 60b4463 commit d93d296

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Determine version
19+
id: vars
20+
run: |
21+
VERSION=$(node -p "require('./package.json').version")
22+
TAG="v$VERSION"
23+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
24+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
25+
26+
- name: Ensure tag does not already exist
27+
run: |
28+
if git rev-parse "${{ steps.vars.outputs.tag }}" >/dev/null 2>&1; then
29+
echo "Tag ${{ steps.vars.outputs.tag }} already exists."
30+
exit 1
31+
fi
32+
33+
- name: Create and push tag
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
git tag -a "${{ steps.vars.outputs.tag }}" -m "Release ${{ steps.vars.outputs.tag }}"
38+
git push origin "${{ steps.vars.outputs.tag }}"
39+
40+
- run: npx changelogithub
41+
env:
42+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rstack-ecosystem-ci",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Rstack Ecosystem CI",
55
"homepage": "https://github.com/rspack-contrib/rstack-ecosystem-ci#readme",
66
"bugs": {

website/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "ecosystem-ci-website",
3-
"version": "0.0.1",
43
"private": true,
54
"type": "module",
65
"scripts": {

0 commit comments

Comments
 (0)