-
Notifications
You must be signed in to change notification settings - Fork 70
78 lines (73 loc) · 2.54 KB
/
github-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
name: Github Release
on:
workflow_call:
inputs:
release_commit:
description: 'OpenVSCode Server release commit'
type: string
required: true
version:
description: 'OpenVSCode Server version'
type: string
required: true
stable:
description: 'Stable or insiders release'
type: boolean
required: true
secrets:
VSCODE_GITHUB_TOKEN:
required: true
SLACK_WEBHOOK:
required: true
jobs:
github-release:
runs-on: ubuntu-latest
name: Publish Github Release
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Create stable release
if: inputs.stable == true
uses: softprops/action-gh-release@v1
with:
repository: ${{ github.repository_owner }}/openvscode-server
target_commitish: ${{ inputs.release_commit }}
body: OpenVSCode Server v${{ inputs.version }}
tag_name: openvscode-server-v${{ inputs.version }}
token: ${{ secrets.VSCODE_GITHUB_TOKEN }}
files: artifacts/**/openvscode-server-*.tar.gz
- name: Delete previous insiders release
if: inputs.stable == false
uses: dev-drprasad/[email protected]
with:
repo: ${{ github.repository_owner }}/openvscode-server
keep_latest: 0
delete_tags: true
delete_tag_pattern: openvscode-server-insiders
env:
GITHUB_TOKEN: ${{ secrets.VSCODE_GITHUB_TOKEN }}
- name: Sleep
if: inputs.stable == false
run: sleep 30s
- name: Create Insiders release
if: inputs.stable == false
uses: softprops/action-gh-release@v1
with:
repository: ${{ github.repository_owner }}/openvscode-server
target_commitish: ${{ inputs.release_commit }}
body: OpenVSCode Server Insiders v${{ inputs.version }}
tag_name: openvscode-server-insiders-v${{ inputs.version }}
prerelease: true
token: ${{ secrets.VSCODE_GITHUB_TOKEN }}
files: artifacts/**/openvscode-server-*.tar.gz
- name: Get previous job's status
id: lastrun
uses: filiptronicek/get-last-job-status@main
- name: Slack Notification
if: ${{ (success() && steps.lastrun.outputs.status == 'failed') || failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}