Skip to content

Commit b1aaf13

Browse files
authored
Merge pull request #17 from BroadcomMFD/semantic-release
ci: add github action for semantic release
2 parents 933d739 + 4de900c commit b1aaf13

File tree

6 files changed

+103
-2
lines changed

6 files changed

+103
-2
lines changed

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-18.04
11+
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Pre-requisities
17+
run: sudo npm install -g vsce
18+
- run: npm install
19+
20+
- name: Update version and changelog
21+
run: npx semantic-release --dry-run
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Package VSIX
25+
run: vsce package
26+
- uses: actions/upload-artifact@v2
27+
with:
28+
name: VSIX
29+
path: "*.vsix"
30+
- name: Commit new version and changelog
31+
run: |
32+
git config --global user.email "actions@github.com"
33+
git config --global user.name "github-actions"
34+
git add package.json CHANGELOG.md
35+
git commit -m "chore: Update version & changelog. [skip ci]"
36+
- name: Push changes
37+
uses: ad-m/github-push-action@v0.6.0
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Rename VSIX
41+
run: mv *.vsix code4z.vsix
42+
- name: Run semantic-release
43+
run: npx semantic-release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
- name: Publish
47+
run: vsce publish
48+
env:
49+
VSCE_PAT: $

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.vscode
2-
*.vsix
2+
*.vsix
3+
4+
node_modules

.releaserc.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
branches:
2+
- master
3+
- name: release-+([0-9]).+([0-9]).+([0-9])
4+
prerelease: beta
5+
ci: true
6+
tagFormat: ${version}
7+
plugins:
8+
- "@semantic-release/commit-analyzer"
9+
- "@semantic-release/release-notes-generator"
10+
- - "@semantic-release/exec"
11+
- generateNotesCmd: sh prepare_release.sh ${nextRelease.version} ${branch.name} "${nextRelease.notes}" ${lastRelease.version} ${Date.now()}
12+
- - "@semantic-release/github"
13+
- assets:
14+
- path: "code4z.vsix"
15+
label: "code4z-${nextRelease.version}.vsix"
16+
name: "code4z-${nextRelease.version}.vsix"

.vscodeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.github
2+
.gitignore

package.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,31 @@
1313
"vscode": "^1.10.0"
1414
},
1515
"keywords": [
16-
"z/OS", "zos", "lsp", "assembler", "hlasm", "zowe", "cobol", "dataset", "mainframe", "explorer", "endevor", "jcl", "uss", "debugger", "ca-intertest", "cics"
16+
"z/OS",
17+
"zos",
18+
"lsp",
19+
"assembler",
20+
"hlasm",
21+
"zowe",
22+
"cobol",
23+
"dataset",
24+
"mainframe",
25+
"explorer",
26+
"endevor",
27+
"jcl",
28+
"uss",
29+
"debugger",
30+
"ca-intertest",
31+
"cics"
1732
],
1833
"categories": [
1934
"Extension Packs"
2035
],
36+
"devDependencies": {
37+
"@semantic-release/changelog": "^5.0.0",
38+
"@semantic-release/exec": "^5.0.0",
39+
"semantic-release": "^17.0.7"
40+
},
2141
"extensionPack": [
2242
"broadcomMFD.cobol-language-support",
2343
"Zowe.vscode-extension-for-zowe",

prepare_release.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -e
2+
set -x
3+
VERSION=$1
4+
CURRENT_BRANCH=$2
5+
RELEASE_NOTES=$3
6+
OLD_VERSION=$4
7+
DATE=$5
8+
9+
{ printf "%s" "$RELEASE_NOTES"; cat CHANGELOG.md; } > tmp.md
10+
mv tmp.md CHANGELOG.md
11+
12+
sed -i 's/"version": ".*"/"version": "'$VERSION'"/g' package.json

0 commit comments

Comments
 (0)