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