This repository has been archived by the owner on Apr 12, 2021. It is now read-only.
forked from confinitum/tornadofx2
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (142 loc) · 4.92 KB
/
build-and-deploy.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
name: CI
on:
push:
schedule:
- cron: '0 3 * * SUN'
jobs:
Build:
strategy:
matrix:
os: [windows, macos, ubuntu]
jvm_version: [8, 11, 14]
runs-on: ${{ matrix.os }}-latest
env:
JAVA_VERSION: ${{ matrix.jvm_version }}
OS: ${{ matrix.os }}
TERM: dumb
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Fetch tags
shell: bash
run: git fetch --tags -f
- name: Populate TAG and BRANCH environment variables
shell: bash
run: |
TAG=$(git describe --tags --exact-match HEAD || echo '')
echo "Current tag is: '$TAG' (setup in the TAG environment variable)"
echo "TAG=$TAG" >> $GITHUB_ENV
BRANCH=$([ -z "$TAG" ] && echo ${GITHUB_REF#refs/heads/} || echo $TAG)
echo "Current tag is: '$BRANCH' (setup in BRANCH TAG environment variable)"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
# Check if the configuration is supported
# COMPATIBLE means the build can run on this matrix combination
# REFERENCE means this is the combination that produces the reference artifacts
# (hence, artifacts from REFERENCE configuration shall be deployed)
# Only one matrix entry should be REFERENCE=true
# If REFERENCE=true, then also COMPATIBLE=true
- shell: bash
run: .github/build-steps/compatibility_check.sh
# Install the JDK
- uses: joschi/setup-jdk@v2.3.0
if: ${{ env.COMPATIBLE == 'true' }}
with:
java-version: ${{ matrix.jvm_version }}
server-id: ossrh
server-username: MAVEN_CENTRAL_USERNAME
server-password: MAVEN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.SIGNING_KEY }}
gpg-passphrase: SIGNING_PASSWORD
# Install additional packages
- name: Configure Linux
shell: bash
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'ubuntu') }}
run: |
if [ -x .github/scripts/configure_linux ]; then
.github/scripts/configure_linux
fi
- name: Configure MacOS X
shell: bash
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'macos') }}
run: |
if [ -f .github/scripts/configure_macos ]; then
.github/scripts/configure_macos
fi
- name: Configure the Windows Pagefile
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'windows') }}
uses: al-cheb/configure-pagefile-action@v1.2
- name: Configure Windows
shell: bash
if: ${{ env.COMPATIBLE == 'true' && contains(matrix.os, 'windows') }}
run: |
if [ -f .github/scripts/configure_windows ]; then
.github/scripts/configure_windows
fi
- name: Build
if: ${{ env.COMPATIBLE == 'true' }}
shell: bash
run: .github/build-steps/build.sh
- name: Check
if: ${{ env.COMPATIBLE == 'true' }}
shell: bash
run: .github/build-steps/check.sh
- name: CodeCov
if: ${{ env.REFERENCE == 'true' }}
uses: codecov/codecov-action@v1
- name: Deploy
if: ${{ env.REFERENCE == 'true' }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
githubToken: ${{ secrets.AUTOMERGE_TOKEN }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
MAVEN_CENTRAL_USERNAME: danysk
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
run: .github/build-steps/deploy.sh
Build-Success:
runs-on: ubuntu-latest
needs: Build
steps:
- shell: bash
run: touch ok
- uses: actions/upload-artifact@v2
with:
name: success
path: ok
CI-Complete:
needs: Build-Success
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: success
- shell: bash
run: '[ -f ok ]'
Automerge:
needs: CI-Complete
runs-on: ubuntu-latest
if: always()
steps:
- name: automerge
uses: "DanySK/yaagha@master"
env:
GITHUB_TOKEN: "${{ secrets.AUTOMERGE_TOKEN }}"
MERGE_FORKS: "false"
MERGE_LABELS: "version-upgrade"
BLOCK_LABELS: "blocked, wontfix, invalid"
MERGE_METHOD: "rebase"
CLOSE_ON_CONFLICT: "true"
DELETE_BRANCH_ON_CLOSE: "true"
GIT_USER_NAME: "Danilo Pianini"
GIT_USER_EMAIL: "danilo.pianini@gmail.com"