-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (70 loc) · 2.14 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Create GitHub Release
env:
NODE_VERSION: 20
on:
push:
tags:
- v*
# Workflow need write access to the repository to create a release
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run markdownlint
run: yarn lint:md
- name: Run ESLint
run: yarn lint:ts
# Convert grammar to PList format & Test compile & Run ESBuild & Generate VSIX file
- name: Create production build
run: yarn build:prod
- name: Create build.txt with version
run: yarn build:txt
- name: Extract changelog
run: |
# Import version from out/build.txt
export VERSION=$(cat out/build.txt | cut -d '=' -f2)
yarn extract-changelog -e $VERSION
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
syntaxes/out/adblock.plist
out/vscode-adblock.vsix
draft: false
prerelease: false
body_path: ./out/TEMP_CHANGES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify:
name: Send Slack notification
needs: release
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{
always() &&
github.repository == 'AdguardTeam/VscodeAdblockSyntax' &&
github.event_name == 'push'
}}
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ needs.release.result }}
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}