-
Notifications
You must be signed in to change notification settings - Fork 12
99 lines (80 loc) · 2.81 KB
/
release.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
tags:
- 'v*'
- '!*nightly*'
branches:
- '**'
jobs:
release-nightly:
uses: ./.github/workflows/release-nightly.yaml
release:
runs-on: ubuntu-latest
# Release the next `nightly` before a stable version
# to prvent folks on pre-releases from being downgraded
needs: release-nightly
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Evaluate version
run: |
PACKAGE_VERSION=${GITHUB_REF##*/v}
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "RELEASE_TAG=v${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "Using version '${PACKAGE_VERSION}'"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Set version
run: npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint
- name: Run unit tests
run: npm run test
- name: Build the extension
run: npm run extension:package
# keeping this two stubbed until we're ready to release
# until then we might want to add tags without actually releasing
# (e.g. to enable rollbacks down the line)
# TODO after repo is public:
# * change baseContentUrl across the repo
# * remove `echo` stubs
- name: Publish the extension
run: |
npx vsce verify-pat -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }}
# echo npx vsce publish \
# -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \
# --baseContentUrl https://bitbucket.org/atlassianlabs/atlascode/src/main/ \
# --packagePath atlascode-${PACKAGE_VERSION}.vsix
- name: Publish to OpenVSX
run: |
npx ovsx verify-pat -p ${{ secrets.OPENVSX_KEY }}
# echo npx ovsx publish \
# -p ${{ secrets.OPENVSX_KEY }} \
# "atlascode-${PACKAGE_VERSION}.vsix"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: Release ${{ env.RELEASE_TAG }}
draft: false
prerelease: false
- name: Upload Release Assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./atlascode-${{ env.PACKAGE_VERSION }}.vsix
asset_name: atlascode-${{ env.PACKAGE_VERSION }}.vsix
asset_content_type: application/zip