-
Notifications
You must be signed in to change notification settings - Fork 40
129 lines (115 loc) · 4.78 KB
/
7_publish.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
name: 7. Publish
run-name: 7. Publish - ${{ inputs.trigger_reason }}
on:
workflow_dispatch:
inputs:
asset_name:
description: 'Name of the .vsix file in the release'
required: true
tag_name:
description: 'The release version/tag to fetch from.'
required: true
trigger_reason:
description: 'Information about what caused the publishing process in the first place.'
required: true
env:
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
PRISMA_TELEMETRY_INFORMATION: 'language-tools 7_publish.yml'
SLACK_USERNAME: Prismo
SLACK_ICON_EMOJI: ':ship:'
SLACK_MSG_AUTHOR: prisma-bot
jobs:
marketplace:
name: Publish to marketplace
runs-on: ubuntu-latest
timeout-minutes: 7
env:
SLACK_MESSAGE: '${{ github.event.inputs.tag_name }} - ${{github.event.inputs.trigger_reason}}'
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Print inputs
run: |
echo ${{github.event.inputs.asset_name}}
echo ${{github.event.inputs.tag_name}}
echo ${{github.event.inputs.trigger_reason}}
- name: Install Dependencies
run: npm install && npm run bootstrap
# Download Asset from GH release and publish to VS Code marketplace
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'prisma/language-tools'
version: 'tags/${{ github.event.inputs.tag_name }}'
file: ${{ github.event.inputs.asset_name }}
token: ${{ secrets.GH_TOKEN }}
- name: publish vsix to marketplace
run: cd packages/vscode && npx vsce publish --pat ${{ secrets.AZURE_DEVOPS_PERSONAL_ACCESS_TOKEN}} --packagePath ${{github.workspace}}/${{ github.event.inputs.asset_name }}
- name: 'Set current job url in SLACK_FOOTER env var'
if: ${{ always() }}
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV
- name: Slack Notification on Failure
if: ${{ failure() }}
uses: rtCamp/[email protected]
env:
SLACK_TITLE: '7. Publishing to marketplace failed :x:'
SLACK_COLOR: '#FF0000'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_FAILURES }}
SLACK_CHANNEL: feed-language-tools-failures
- name: Slack Notification on Success
if: ${{ success() }}
uses: rtCamp/[email protected]
env:
SLACK_TITLE: '7. Published to marketplace :white_check_mark:'
SLACK_COLOR: '#008000'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: feed-language-tools
open-vsx:
name: Publish to open-vsx
runs-on: ubuntu-latest
timeout-minutes: 7
env:
SLACK_MESSAGE: '${{ github.event.inputs.tag_name }} - ${{github.event.inputs.trigger_reason}}'
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Print inputs
run: |
echo ${{github.event.inputs.trigger_reason}}
- name: Install Dependencies
run: npm install && npm run bootstrap
# Download Asset from GH release and publish to open-vsx
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'prisma/language-tools'
version: 'tags/${{ github.event.inputs.tag_name }}'
file: ${{ github.event.inputs.asset_name }}
token: ${{ secrets.GH_TOKEN }}
- name: Publish vsix to open-vsx.org
run: cd packages/vscode && npx ovsx publish ${{github.workspace}}/${{ github.event.inputs.asset_name }} --pat ${{ secrets.OPEN_VSX_ACCESS_TOKEN }}
- name: 'Set current job url in SLACK_FOOTER env var'
if: ${{ always() }}
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> $GITHUB_ENV
- name: Slack Notification on Failure
if: ${{ failure() }}
uses: rtCamp/[email protected]
env:
SLACK_TITLE: '7. Publishing to open-vsx failed :x:'
SLACK_COLOR: '#FF0000'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_FAILURES }}
SLACK_CHANNEL: feed-language-tools-failures
- name: Slack Notification on Success
if: ${{ success() }}
uses: rtCamp/[email protected]
env:
SLACK_TITLE: '7. Published to open-vsx :white_check_mark:'
SLACK_COLOR: '#008000'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: feed-language-tools