-
Notifications
You must be signed in to change notification settings - Fork 33
62 lines (59 loc) · 2.05 KB
/
release.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
name: Release
on:
push:
branches:
- 'main'
repository_dispatch:
workflow_dispatch:
jobs:
checksecret:
name: check if VSCODE_MARKETPLACE_TLAPLUS_TOKEN is set in github secrets
runs-on: ubuntu-latest
outputs:
is_MY_SECRET_set: ${{ steps.checksecret_job.outputs.is_MY_SECRET_set }}
steps:
- name: Check secret present
id: checksecret_job
env:
MY_SECRET: ${{ secrets.VSCODE_MARKETPLACE_TLAPLUS_TOKEN }}
run: |
echo "is_MY_SECRET_set: ${{ env.MY_SECRET != '' }}"
echo "::set-output name=is_MY_SECRET_set::${{ env.MY_SECRET != '' }}"
build:
## Do not run this action without the marketplace token present,
## e.g., in a fork of this repo.
needs: [checksecret]
if: needs.checksecret.outputs.is_MY_SECRET_set == 'true'
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '18.19'
- name: Get (latest) TLC
run: wget https://nightly.tlapl.us/dist/tla2tools.jar -O tools/tla2tools.jar
- name: Get (latest) CommunityModules
run: wget https://github.com/tlaplus/CommunityModules/releases/latest/download/CommunityModules-deps.jar -O tools/CommunityModules-deps.jar
- name: Prepare Release
run: |
## Create a git commit to use its date as the extension's version number below.
git add tools/*.jar -f
git commit -m "Latest CommunityModules and TLA+ tools"
- name: Get current version
id: version
run: echo "::set-output name=version::$(git log -1 --format=%cd --date="format:%Y.%-m.%-d%H%M")"
- name: Install dependencies
run: |
npm install
npm install -g vsce
- name: Build
run: |
npm run vscode:prepublish
vsce package
- name: Check
run: |
npm run lint
npm test --silent
- name: Publish to Marketplace
run: |
vsce publish $(git log -1 --format=%cd --date="format:%Y.%-m.%-d%H%M") --pat "${{ secrets.VSCODE_MARKETPLACE_TLAPLUS_TOKEN }}"