-
Notifications
You must be signed in to change notification settings - Fork 15
95 lines (81 loc) · 2.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
name: Publish release
on:
workflow_dispatch:
inputs:
version:
description: Name of release
required: true
publish:
type: boolean
description: Would release be published
required: true
default: true
draft:
type: boolean
description: Publish draft first
required: true
default: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-instance
jobs:
build:
name: Create artifacts from master
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'src/frontend/package-lock.json'
- name: Setup Java
uses: actions/setup-java@master
with:
distribution: adopt
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with gradle
run: ./gradlew release --scan -Pnpm.download=false -Pbuild_version=${{ github.event.inputs.version }} -i
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: artifacts
path: artifacts
- name: Create release
if: ${{ github.event.inputs.publish }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "v${{ github.event.inputs.version }}"
draft: ${{ github.event.inputs.draft }}
files: |
artifacts/*.jar
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}},value=${{ github.event.inputs.version }}
type=schedule,pattern={{date 'YYYYMMDD'}}
- name: Copy live.jar into cloud overlayer
run: cp artifacts/live-v3-*.jar ./src/cloud-instance-docker/live.jar
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./src/cloud-instance-docker/
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}