-
Notifications
You must be signed in to change notification settings - Fork 8
79 lines (65 loc) · 2.11 KB
/
cd.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: CD
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
permissions: {}
jobs:
publish-latest-update-site:
name: Publish Latest Extension # (from main branch only)
runs-on: ubuntu-latest
# we are very restrictive when this runs, i.e. only on main, only on success and only with the bazel-vscode-java repository (not on forks)
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event != 'pull_request' &&
github.repository == 'salesforce/bazel-vscode-java' &&
github.ref == 'refs/heads/main'
permissions:
actions: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Time for BUILD_ID
id: time
uses: nanzm/[email protected]
with:
format: "YYYYMMDD_HHmm"
- name: Get Branch name for BUILD_LABEL
id: branch_name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Setup Node version
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- name: 📦 Install dependencies
run: npm ci
- name: Download Bazel JDT Language Server extension
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
name: server
path: server
- name: 🏗 Build project
env:
BUILD_ID: "${{ steps.time.outputs.time }}"
BUILD_TYPE: "S"
BUILD_LABEL: "CI ${{ steps.time.outputs.time }} (${{ steps.branch_name.outputs.branch }})"
run: npm run build
- name: Trigger VS Code Extension publish workflow to edge channel
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'publish.yml',
ref: 'main',
inputs: {
releaseChannel: 'edge'
}
});