Skip to content

Commit 8f15bb2

Browse files
committed
move npm release to own workflow, automate github release creation
1 parent b6e5981 commit 8f15bb2

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
release:
8-
types: [published]
97

108
permissions:
119
contents: read
@@ -73,11 +71,3 @@ jobs:
7371
with:
7472
name: cml-language-server
7573
path: ./cml-ls/
76-
77-
- name: Prepare publication
78-
if: github.event_name == 'release' # Publish only on release creation
79-
run: sed -i -e 's/<TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .yarnrc.yml
80-
81-
- name: Publish to GitHub Package Registry
82-
if: github.event_name == 'release' # Publish only on release creation
83-
run: yarn npm publish --access public

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release-build:
10+
uses: ./.github/workflows/build.yml
11+
secrets: inherit
12+
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
20+
fetch-depth: 0 # a full history is required for pull request analysis
21+
- name: Download language-server artifact
22+
uses: actions/download-artifact@v4
23+
with:
24+
name: cml-language-server
25+
path: ./cml-ls
26+
27+
- name: Prepare publication
28+
run: sed -i -e 's/<TOKEN>/${{ secrets.GITHUB_TOKEN }}/g' .yarnrc.yml
29+
30+
- name: Publish to GitHub Package Registry
31+
run: yarn npm publish --access public
32+
33+
- name: Create GitHub release
34+
id: create_release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
files: ./cml-ls

0 commit comments

Comments
 (0)