@@ -3,29 +3,43 @@ name: Release
3
3
on :
4
4
push :
5
5
tags :
6
- - ' **'
6
+ - ' v*'
7
+ - ' !*nightly*'
7
8
8
9
jobs :
10
+ release-nightly :
11
+ uses : ./.github/workflows/release-nightly.yaml
12
+
9
13
release :
10
14
runs-on : ubuntu-latest
15
+
16
+ # Release the next `nightly` before a stable version
17
+ # to prvent folks on pre-releases from being downgraded
18
+ needs : release-nightly
19
+
20
+ permissions :
21
+ contents : write
22
+
11
23
steps :
12
24
13
25
- uses : actions/checkout@v4
14
26
27
+ - name : Evaluate version
28
+ run : |
29
+ PACKAGE_VERSION=${GITHUB_REF##*/v}
30
+ ./scripts/version/assert-stable.sh $PACKAGE_VERSION
31
+ echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
32
+ echo "RELEASE_TAG=v${PACKAGE_VERSION}" >> $GITHUB_ENV
33
+ echo "Using version '${PACKAGE_VERSION}'"
34
+
15
35
- name : Set up Node.js
16
36
uses : actions/setup-node@v4
17
37
with :
18
38
node-version : 20
19
39
cache : ' npm'
20
40
21
- - name : Evaluate version
22
- run : |
23
- RELEASE_VERSION=${GITHUB_REF##*/v} && \
24
- echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV && \
25
- echo "Using version '${RELEASE_VERSION}'"
26
-
27
41
- name : Set version
28
- run : npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION
42
+ run : npm -no-git-tag-version --allow-same-version -f version $PACKAGE_VERSION
29
43
30
44
- name : Install dependencies
31
45
run : npm install
@@ -52,12 +66,33 @@ jobs:
52
66
# echo npx vsce publish \
53
67
# -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \
54
68
# --baseContentUrl https://bitbucket.org/atlassianlabs/atlascode/src/main/ \
55
- # --packagePath atlascode-${GITHUB_REF##*/v }.vsix
69
+ # --packagePath atlascode-${PACKAGE_VERSION }.vsix
56
70
57
71
- name : Publish to OpenVSX
58
72
run : |
59
73
npx ovsx verify-pat -p ${{ secrets.OPENVSX_KEY }}
60
74
# echo npx ovsx publish \
61
75
# -p ${{ secrets.OPENVSX_KEY }} \
62
- # "atlascode-${GITHUB_REF##*/v }.vsix"
76
+ # "atlascode-${PACKAGE_VERSION }.vsix"
63
77
78
+ - name : Create Release
79
+ id : create_release
80
+ uses : actions/create-release@v1
81
+ env :
82
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
83
+ with :
84
+ tag_name : ${{ env.RELEASE_TAG }}
85
+ release_name : Release ${{ env.RELEASE_TAG }}
86
+ draft : false
87
+ prerelease : false
88
+
89
+ - name : Upload Release Assets
90
+ id : upload-release-asset
91
+ uses : actions/upload-release-asset@v1
92
+ env :
93
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
+ with :
95
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
96
+ asset_path : ./atlascode-${{ env.PACKAGE_VERSION }}.vsix
97
+ asset_name : atlascode-${{ env.PACKAGE_VERSION }}.vsix
98
+ asset_content_type : application/zip
0 commit comments