-
-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·168 lines (142 loc) · 4.71 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
159
160
161
162
163
164
165
166
167
168
name: build and release container
on:
push:
# branches:
# - development
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
compile:
name: compile web
runs-on: ubuntu-20.04
container:
image: ghcr.io/metaheed/kolle-ci:v0.0.2
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
java: [ '11' ]
steps:
- name: Check out main repo
uses: actions/checkout@v2
- name: Checkout impl repo
uses: actions/checkout@v2
with:
repository: metaheed/metarx.io
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT. need to generate this key from github personal setting
path: kolle
- name: Maven cache
id: maven-cache
uses: actions/cache@v2
with:
path: /root/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/shadow-cljs.edn', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-maven-
- name: npm cache
uses: actions/cache@v2
with:
path: /root/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('webapp/shadow-cljs.edn') }}-${{ hashFiles('**/deps.cljs') }}
restore-keys: |
${{ runner.os }}-npm-
- name: npx package Module cache
id: npx-module-cache
uses: actions/cache@v2
with:
path: kolle/webapp/node_modules
key: ${{ runner.os }}-maven-${{ hashFiles('kolle/webapp/package.json', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-module-
- name: shadow-cljs compiler cache
uses: actions/cache@v2
with:
path: kolle/webapp/.shadow-cljs
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
restore-keys: |
${{ runner.os }}-shadow-cljs-
- if: steps.npx-module-cache.outputs.cache-hit != 'true'
working-directory: kolle/webapp
run: |
npm i --force
- name: shadow-cljs build prod
working-directory: kolle/webapp
run: |
npm i --force
npx shadow-cljs release prod
- uses: actions/upload-artifact@v3
with:
name: kollejs
path: kolle/resources/public/js/main.js
package:
name: Build docker and release package
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Checkout impl repo
uses: actions/checkout@v2
with:
repository: metaheed/metarx.io
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT. need to generate this key from github personal setting
path: kolle
- name: Down load artificat
uses: actions/download-artifact@v3
with:
name: kollejs
- name: Copy file
run: |
mkdir -p kolle/resources/public/js/
cp main.js kolle/resources/public/js/
- name: Maven cache
id: maven-cache
uses: actions/cache@v2
with:
path: /root/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@master
with:
tools-deps: '1.10.3.1029'
- name: Build clj artifact
working-directory: kolle
run: |
clojure -T:build package
- name: Get the tag version
id: get_version
shell: bash
run: echo "##[set-output name=VERSION;]$(echo ${GITHUB_REF#refs/tags/})"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: metaheed/kolle
workdir: kolle/build/container
tags: "latest,${{ steps.get_version.outputs.VERSION }}"
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
platforms: linux/amd64,linux/arm64
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
body: |
[Changelog](https://github.com/metaheed/kolle.io)
draft: false
prerelease: false