-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.17 KB
/
generator-draft-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Publish Release
on:
workflow_call:
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
- name: Clean release tags
run: ./clean-release-tags.sh
- name: Get latest tag
run: |
latest_tag=$(git show-ref -s "$(./get-latest-tag.sh)")
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_PAT }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v1.0.0',
sha: '${{ env.LATEST_TAG}}'
})
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- name: Create draft release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clean release tags
if: always()
run: ./clean-release-tags.sh