-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (44 loc) · 1.35 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
name: Release
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.x"
- name: Display dotnet version
run: dotnet --version
- name: Compile
run: make
- name: Zip rules directory
run: |
mkdir MxLintExtension
cp -r bin/Debug/net8.0/* MxLintExtension
zip -r extension.zip MxLintExtension
- name: Get release
id: get_release
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const release = await github.rest.repos.getRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id
});
core.setOutput('upload_url', release.data.upload_url);
core.setOutput('tag_name', release.data.tag_name);
- name: Upload Release Asset (ZIP)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./extension.zip
asset_name: MxLintExtension-${{ steps.get_release.outputs.tag_name}}.zip
asset_content_type: application/zip