-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.55 KB
/
main.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
name: Main
on:
pull_request:
push:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v3
- name: install nix
uses: cachix/install-nix-action@v18
- name: check flake
run: nix flake check
- name: build package
id: package
run: |
nix build
echo path=$(echo result/*.vsix) >> $GITHUB_OUTPUT
- name: get latest tag
id: latest
uses: actions-ecosystem/action-get-latest-tag@v1
- name: parse changelog
id: changelog
uses: coditory/changelog-parser@v1
- name: create release
id: release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main' && steps.changelog.outputs.version != steps.latest.outputs.tag
with:
files: ${{ steps.package.outputs.path }}
body: ${{ steps.changelog.outputs.description }}
tag_name: ${{ steps.changelog.outputs.version }}
- name: publish to Open VSX
uses: HaaLeo/publish-vscode-extension@v1
if: steps.release.outcome == 'success'
with:
pat: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
extensionFile: ${{ steps.package.outputs.path }}
- name: publish to VS Marketplace
uses: HaaLeo/publish-vscode-extension@v1
if: steps.release.outcome == 'success'
with:
pat: ${{ secrets.AZURE_ACCESS_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.package.outputs.path }}