-
Notifications
You must be signed in to change notification settings - Fork 5
139 lines (117 loc) · 3.92 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
pull_request:
types: closed
jobs:
tag:
name: Create Tag
runs-on: ubuntu-latest
if: github.event.pull_request.merged && (github.base_ref == 'develop' || github.base_ref == 'master')
outputs:
tag: ${{ steps.calculate.outputs.next_tag }}
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Python
uses: actions/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .scripts/requirements.txt
- name: Get Latest Tag
id: latest_tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Calculate next tag
id: calculate
run: python .scripts/release.py ${{ steps.latest_tag.outputs.tag }} ${{ github.event.pull_request.number }} ${{ github.base_ref }}
- name: Create Tag
id: create_tag
uses: K-Phoen/semver-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_branch: ${{ github.base_ref }}
release_strategy: tag
tag_format: ${{ env.TAG_FORMAT }}
tag: ${{ steps.calculate.outputs.next_tag }}
- name: Force Create Tag
uses: richardsimko/update-tag@v1
with:
tag_name: ${{ steps.calculate.outputs.next_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Release
runs-on: ubuntu-latest
needs: [tag]
steps:
- name: Create Draft Release
uses: release-drafter/[email protected]
if: github.base_ref == 'develop'
with:
tag: ${{needs.tag.outputs.tag}}
version: ${{needs.tag.outputs.tag}}
publish: true
prerelease: true
name: v${{needs.tag.outputs.tag}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: release-drafter/[email protected]
if: github.base_ref == 'master'
with:
tag: ${{needs.tag.outputs.tag}}
version: ${{needs.tag.outputs.tag}}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload:
name: Upload Assests
runs-on: ubuntu-latest
needs: [tag, release]
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
ref: ${{ github.base_ref }}
submodules: 'true'
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Build groovy-language-server
run: yarn run build-server
- name: Build vscode extension
run: yarn run build-extension ${{needs.tag.outputs.tag}}
- name: Upload groovy-language-server
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/groovy-language-server-all.jar
tag: ${{needs.tag.outputs.tag}}
overwrite: true
- name: Upload extension
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: groovy-guru-${{needs.tag.outputs.tag}}.vsix
tag: ${{needs.tag.outputs.tag}}
overwrite: true
- name: Publish Extension
if: github.base_ref == 'master'
run: yarn run publish groovy-guru-${{needs.tag.outputs.tag}}.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish Extension to OVSX
if: github.base_ref == 'master'
run: yarn run ovsx publish groovy-guru-${{needs.tag.outputs.tag}}.vsix -p ${{ secrets.OVSX_PAT }}