-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (78 loc) · 2.72 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
name: "Release"
on:
workflow_dispatch:
inputs:
versionName:
description: 'Version name (1.2.3)'
required: true
jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup java
uses: actions/[email protected]
with:
distribution: 'adopt-hotspot'
java-version: '16'
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Running gradle publish
uses: eskatos/[email protected]
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
with:
arguments: publish --no-daemon
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ github.event.inputs.versionName }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
version: ${{ github.event.inputs.versionName }}
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Automatic release commits for ${{ github.event.inputs.versionName }}
branch: master
- name: Docker Build and Push
uses: philpotisk/github-action-docker-build-push@master
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
DOCKER_FILE: Dockerfile
CONTAINER_TAG: waltid/ssikit:${{ github.event.inputs.versionName }}
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
tag_name: ${{ github.event.inputs.versionName }}
files: |
LICENSE.txt
build/libs/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare CD K8S
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" k8s/deployment-prod.yaml > k8s/deployment-prod_mod.yaml
- name: Continuous deployment K8S
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_PROD }}
with:
args: apply -n default -f k8s/deployment-prod_mod.yaml