-
Notifications
You must be signed in to change notification settings - Fork 405
93 lines (86 loc) · 3.73 KB
/
publishVSCode.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
name: Publish in Microsoft Marketplace
on:
release:
# This limits the workflow to releases that are not pre-releases
# From the docs: A release was published, or a pre-release was changed to a release.
types: [ released ]
# Button for publishing main branch in case there is a failure on the release.
workflow_dispatch:
jobs:
publish-start-notification:
name: "Publish in MS Marketplace Start Notification"
uses: ./.github/workflows/slackNotification.yml
secrets: inherit
with:
title: "Publish in MS Marketplace waiting for approval in github."
notification: "New Release triggered publish build and job is ready for approval."
type: "notification"
workflow: "publishVSCode.yml"
prepare-environment-from-main:
name: 'Get Release Version'
runs-on: ubuntu-latest
environment: publish
outputs:
RELEASE_VERSION: ${{ steps.getMainVersion.outputs.version }}
GUS_BUILD: ${{ steps.getGusBuild.outputs.gusBuild}}
SF_CHANGE_CASE_SCHEDULE_BUILD: ${{ steps.getScheduledBuild.outputs.sfChangeCaseScheduleBuild }}
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
- id: getMainVersion
run: |
echo "version="$(node -pe "require('./packages/salesforcedx-vscode/package.json').version")"" >> $GITHUB_OUTPUT
- run: echo "Main Version is ${{ steps.getMainVersion.outputs.version }}"
- id: getGusBuild
run: |
echo "gusBuild=${{ steps.getMainVersion.outputs.version }}" >> $GITHUB_OUTPUT
- run: echo "GUS BUILD is ${{ steps.getGusBuild.outputs.gusBuild }}"
- id: getScheduledBuild
run: |
echo "sfChangeCaseScheduleBuild=offcore.tooling.${{ steps.getMainVersion.outputs.version }}" >> $GITHUB_OUTPUT
- run: echo "SF_CHANGE_CASE_SCHEDULE_BUILD is ${{ steps.getScheduledBuild.outputs.sfChangeCaseScheduleBuild }}"\
ctc-open:
needs: [ prepare-environment-from-main ]
uses: salesforcecli/github-workflows/.github/workflows/ctcOpen.yml@main
secrets: inherit
publish:
needs: [ 'ctc-open', 'prepare-environment-from-main' ]
runs-on: ubuntu-latest
env:
VSCE_PERSONAL_ACCESS_TOKEN: ${{ secrets.VSCE_PERSONAL_ACCESS_TOKEN }}
PUBLISH_VERSION: ${{ needs.prepare-environment-from-main.outputs.RELEASE_VERSION }}
GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'main'
token: ${{ secrets.IDEE_GH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: downloadExtensionsFromRelease
run: |
mkdir ./extensions
gh release download v${{ env.PUBLISH_VERSION }} -D ./extensions
- name: Display downloaded vsix files
run: ls -R ./extensions
- run: npm ci
- run: find ./extensions -type f -name "*.vsix" -exec npx vsce publish --pat ${{ env.VSCE_PERSONAL_ACCESS_TOKEN }} --packagePath {} \;
- run: echo "SUCCESSFULLY published"
ctcCloseSuccess:
needs: [ctc-open, publish]
if: needs.ctc-open.result == 'success' && needs.publish.result == 'success' && needs.ctc-open.outputs.changeCaseId
uses: salesforcecli/github-workflows/.github/workflows/ctcClose.yml@main
secrets: inherit
with:
changeCaseId: ${{needs.ctc-open.outputs.changeCaseId}}
ctcCloseFail:
needs: [ctc-open, publish]
if: always() && inputs.ctc && needs.ctc-open.outputs.changeCaseId && (needs.ctc-open.result != 'success' || needs.publish.result != 'success')
uses: salesforcecli/github-workflows/.github/workflows/ctcClose.yml@main
secrets: inherit
with:
changeCaseId: ${{ needs.ctc-open.outputs.changeCaseId }}
status: Not Implemented