Skip to content

Commit 71e08d3

Browse files
committed
Updated release workflow (based of Code for i's)
Signed-off-by: Seb Julliand <sebjulliand@gmail.com>
1 parent ce4f6a8 commit 71e08d3

File tree

2 files changed

+329
-170
lines changed

2 files changed

+329
-170
lines changed

.github/workflows/ci.yaml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,59 @@ on:
55
jobs:
66
release:
77
name: Release and publish
8+
89
runs-on: ubuntu-latest
10+
911
steps:
12+
- name: Install nodeJS 20
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: 20
16+
registry-url: 'https://registry.npmjs.org'
1017

11-
# Setup prereqs
12-
- uses: actions/setup-node@v3
18+
- name: Checkout master branch
19+
uses: actions/checkout@v3
1320
with:
14-
node-version: '20'
15-
- uses: actions/checkout@v3
21+
ref: master
22+
23+
- name: Install dependencies
1624
- run: npm install
17-
- run: npm install -g vsce
1825

19-
# Create and publish build to Marketplace
20-
- name: Publish to Marketplace
21-
run: vsce publish -p $PUBLISHER_TOKEN
22-
env:
23-
PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
26+
- name: Update version number
27+
run: npm version --allow-same-version --no-git-tag-version ${{ github.ref_name }}
28+
29+
- name: Package
30+
run: npx @vscode/vsce package --allow-package-all-secrets
31+
32+
- name: Publish
33+
run: |
34+
npx @vscode/vsce publish --skip-duplicate --packagePath code-for-ibmi-${{ github.ref_name }}.vsix --pat ${{ secrets.PUBLISHER_TOKEN }}
35+
npx ovsx publish --skip-duplicate --packagePath code-for-ibmi-${{ github.ref_name }}.vsix --pat ${{ secrets.OPENVSX_TOKEN }}
36+
37+
- name: Attach vsix
38+
uses: svenstaro/upload-release-action@v2
39+
with:
40+
repo_token: ${{ secrets.GITHUB_TOKEN }}
41+
tag: ${{ github.ref_name }}
42+
asset_name: vscode-rpgle-${{ github.ref_name }}.vsix
43+
file: vscode-rpgle-${{ github.ref_name }}.vsix
44+
45+
- name: Commit changes and move release tag
46+
run: |
47+
git config user.name 'github-actions[bot]'
48+
git config user.email 'github-actions[bot]@users.noreply.github.com'
49+
git commit --allow-empty -a -m "Release ${{ github.ref_name }}"
50+
git tag -f ${{ github.ref_name }}
51+
git push --tags --force
52+
53+
- name: Bump version number for next cycle
54+
run: npm version --no-git-tag-version prerelease --preid dev
55+
56+
- name: Read new version
57+
id: new-version
58+
uses: beaconbrigade/package-json-version@v0.3
2459

25-
# Create and publish build to OpenVSX
26-
- name: Publish to Open VSX
27-
run: npx ovsx publish -p ${{ secrets.OPENVSX_TOKEN }}
28-
60+
- name: Commit version number change
61+
run: |
62+
git commit -a -m "Starting ${{ steps.new-version.outputs.version }} development"
63+
git push

0 commit comments

Comments
 (0)