-
Notifications
You must be signed in to change notification settings - Fork 1
158 lines (127 loc) · 4.66 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Release
env:
JAVA_ENV_VERSION: '21' # LTS version
NODEJS_VERSION: '21.2.0' # TODO: updated for LTS (being 22 for langium?)
on:
push:
tags:
- '*.*.*' # Only Admin can push such tags
permissions: write-all
jobs:
build_compiler:
defaults:
run:
working-directory: './compiler'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_ENV_VERSION}}
distribution: 'adopt'
cache: 'maven'
- name: Build compiler
run: |
mvn install
- name: Upload JAR artefact
uses: actions/upload-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.jar
path: compiler/jpipe.jar
build_extension:
defaults:
run:
working-directory: './langium'
runs-on: ubuntu-latest
needs: [build_compiler]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up node.js
uses: actions/setup-node@v4
with:
node-version: '${{env.NODEJS_VERSION}}'
- name: retrieve compiler
uses: actions/download-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.jar
path: langium/jar/
- name: build extension
run: |
npm install
npm install -g @vscode/vsce
vsce package -o jpipe-extension.vsix
- name: Upload VSIX artefact
uses: actions/upload-artifact@v4
with:
name: jpipe-extension-${{ github.ref_name }}.vsix
path: langium/jpipe-extension.vsix
build_homebrew:
defaults:
run:
working-directory: './homebrew'
runs-on: ubuntu-latest
needs: [build_compiler]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: retrieve compiler
uses: actions/download-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.jar
path: homebrew/
- name: Create Homebrew artefact
run: |
tar czvf jpipe-${{ github.ref_name }}.tar.gz *
- name: Upload Homebrew artefact
uses: actions/upload-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.tar.gz
path: homebrew/jpipe-${{ github.ref_name }}.tar.gz
release_artefacts:
runs-on: ubuntu-latest
needs: [build_compiler, build_extension, build_homebrew]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release directory
run: |
mkdir release
- name: retrieve compiler
uses: actions/download-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.jar
path: release/
- name: retrieve extension
uses: actions/download-artifact@v4
with:
name: jpipe-extension-${{ github.ref_name }}.vsix
path: release/
- name: retrieve homebrew
uses: actions/download-artifact@v4
with:
name: jpipe-${{ github.ref_name }}.tar.gz
path: release/
- name: List artefacts to release
run: |
ls -lh release
- name: Create the release on GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "release/*"
body: "Release automatically created by the CI/CD pipeline"
name: "Release ${{github.ref_name}}"
- name: Delete compiler artefact
uses: geekyeggo/delete-artifact@v5
with:
name: jpipe-${{ github.ref_name }}.jar
- name: Delete extension artefact
uses: geekyeggo/delete-artifact@v5
with:
name: jpipe-extension-${{ github.ref_name }}.vsix
- name: Delete homebrew artefact
uses: geekyeggo/delete-artifact@v5
with:
name: jpipe-${{ github.ref_name }}.tar.gz