Skip to content

Commit d507609

Browse files
committed
add release step
1 parent 704c9d7 commit d507609

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
workflow_dispatch:
77

8-
# Permissions needed to push to gh-pages
8+
# Permissions needed to push to gh-pages and create releases
99
permissions:
1010
contents: write
1111
pages: write
@@ -79,6 +79,35 @@ jobs:
7979
cd ..
8080
npm test
8181
82+
release:
83+
needs: [openapi-client-generation, test]
84+
if: github.ref == 'refs/heads/main'
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Set up Node.js
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: '20.x'
95+
cache: 'npm'
96+
97+
- name: Install dependencies
98+
run: npm ci
99+
100+
- name: Configure Git
101+
run: |
102+
git config --global user.name "GitHub Actions"
103+
git config --global user.email "[email protected]"
104+
105+
- name: Release
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
109+
run: npm run release
110+
82111
docs:
83112
runs-on: ubuntu-latest
84113
permissions:

0 commit comments

Comments
 (0)