-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (95 loc) · 3.56 KB
/
buildDeploy.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
# JACIS Continuous Integration GITHUB workflow
name: JACIS-CI-Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
release:
description: 'Release Build'
default: false
jobs:
build-and-test:
name: Build and Test JACIS
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
java: [ 8, 11, 17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fix Permissions
run: chmod +x gradlew
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Test
uses: gradle/gradle-build-action@v2
with:
arguments: build --scan -Dreleasebuild=${{ github.event.inputs.release }}
deploy:
name: Deploy JACIS
needs: build-and-test
runs-on: windows-latest
steps:
- name: Check if this is a Release Build
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true' }}
run: echo "THIS IS A RELEASE BUILD!"
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Deploy ( to https://maven.pkg.github.com/janwiemer/jacis )
uses: gradle/gradle-build-action@v2
with:
arguments: publish --scan -Dreleasebuild=${{ github.event.inputs.release }} -Dusedateversion=true -Ddeploy_user=JanWiemer -Ddeploy_pw=${{secrets.GITHUB_TOKEN}} -Ddeploy_repo_release=https://maven.pkg.github.com/janwiemer/jacis -Ddeploy_repo_snapshot=https://maven.pkg.github.com/janwiemer/jacis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Determine Release versions
if: ${{ github.event.inputs.release }} == true
uses: HardNorth/github-version-generate@v1.3.0
with:
version-source: file
version-file: gradle.properties
version-file-extraction-pattern: '(?<=version=).+'
- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYYMMDD
- name: Log Release Version
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true' }}
run: echo "version=${{ env.RELEASE_VERSION }}"
- name: Log Snapshot Version
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.release != 'true' }}
run: echo "version=${{ env.RELEASE_VERSION }}-build${{ steps.current-time.outputs.formattedTime }}-SNAPSHOT"
- name: Create Release
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ env.RELEASE_VERSION }}"
release_name: Release ${{ env.RELEASE_VERSION }}
body: |
To use this JACIS version add the following dependency to your project:
<dependency>
<groupId>org.jacis</groupId>
<artifactId>jacis</artifactId>
<version>${{ env.RELEASE_VERSION }}</version>
</dependency>
For Gradle the dependency looks like:
dependencies {
implementation group: 'org.jacis', name: 'jacis', version: '${{ env.RELEASE_VERSION }}'
}
draft: false
prerelease: false