-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.96 KB
/
publish.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: 'Build and release Aqua VSCE'
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq
- name: Get version from npm and increment
run: |
VERSION="1.0.${{ github.run_number }}"
PKG_NAME="$(cat package.json | jq -r .name)"
# save info to env
echo "FINAL_VERSION=$VERSION" | tee -a $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" | tee -a $GITHUB_ENV
echo "PKG_FILE=${PKG_NAME}-${VERSION}.vsix" | tee -a $GITHUB_ENV
- name: Set version to ${{ env.FINAL_VERSION }}
run: |
yarn version --new-version ${{ env.FINAL_VERSION }} --no-git-tag-version
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Package and publish
run: |
npm i
npm i -g vsce
vsce package
vsce publish -p ${{ secrets.VSCE_PAT }}
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.FINAL_VERSION }}
name: Aqua VSCE ${{ env.FINAL_VERSION }}
body: |
Version: ${{ env.FINAL_VERSION }}
files: |
${{ env.PKG_FILE }}
draft: true
prerelease: false