-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 3.23 KB
/
draft-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
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
100
name: release
on:
push:
tags: '*'
env:
CARGO_TERM_COLOR: always
IS_PRE_RELEASE: ${{ contains(github.ref_name, 'dev') }}
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code_target: linux-x64
- os: windows-latest
target: x86_64-pc-windows-msvc
code_target: win32-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup npm
uses: actions/setup-node@v4
- name: Setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build xtask
run: cargo build --package xtask --release
- name: Prepare the server executable
run: cargo xtask prep-server --target ${{ matrix.target }} --release
- name: Package the extension (pre-release)
if: ${{ env.IS_PRE_RELEASE == 'true' }}
run: cargo xtask package --pre-release -o "witcherscript-ide-${{ github.ref_name }}-${{ matrix.target }}.vsix" --target ${{ matrix.code_target }}
- name: Package the extension (main release)
if: ${{ env.IS_PRE_RELEASE == 'false' }}
run: cargo xtask package -o "witcherscript-ide-${{ github.ref_name }}-${{ matrix.target }}.vsix" --target ${{ matrix.code_target }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: "*.vsix"
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Prepare artifact list for release action
run: echo "ARTIFACTS=$(echo $(find . -iname "*.vsix") | sed "s/ /,/g")" >> $GITHUB_ENV
- name: Create draft release on GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.ARTIFACTS }}"
draft: true
allowUpdates: true
generateReleaseNotes: true
prerelease: ${{ env.IS_PRE_RELEASE }}
# The VS Marketplace doesn't yet support pre-release semver versions, sigh....
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions
# - name: Upload extension to VSCode Marketplace (pre-release)
# if: ${{ env.IS_PRE_RELEASE == 'true' }}
# run: npx vsce publish --pre-release --packagePath $(find . -iname *.vsix)
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Upload extension to VSCode Marketplace (main release)
if: ${{ env.IS_PRE_RELEASE == 'false' }}
run: npx vsce publish --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
# - name: Upload extension to Open VSX Registry (pre-release)
# if: ${{ env.IS_PRE_RELEASE == 'true' }}
# run: npx ovsx publish --pre-release --packagePath $(find . -iname *.vsix)
# env:
# OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Upload extension to Open VSX Registry (main release)
if: ${{ env.IS_PRE_RELEASE == 'false' }}
run: npx ovsx publish --packagePath $(find . -iname *.vsix)
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}