-
Notifications
You must be signed in to change notification settings - Fork 11
82 lines (66 loc) · 2.15 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
name: Release
on:
workflow_dispatch:
jobs:
prepare-release:
runs-on: ubuntu-latest
outputs:
NEXT_RELEASE: ${{ env.NEXT_RELEASE }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "github"
- name: Configure Git User
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
- name: Install dependencies needed
run: $GITHUB_WORKSPACE/install_dependencies.sh
- name: Prepare Maven Release
run: |
./mvnw --batch-mode release:prepare
NEXT_RELEASE=$(grep -r 'scm.tag=' release.properties | sed 's/scm.tag=//')
echo "NEXT_RELEASE=$NEXT_RELEASE" >> $GITHUB_ENV
upload-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs: [ prepare-release ]
env:
NEXT_RELEASE: ${{ needs.prepare-release.outputs.NEXT_RELEASE }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.NEXT_RELEASE }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "github"
- name: Configure Git User
run: |
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
- name: Install dependencies needed
run: $GITHUB_WORKSPACE/install_dependencies.sh
- name: Create docker Release
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
./mvnw --batch-mode clean install jib:build -Ddocker.tag=${{ env.NEXT_RELEASE }}
docker logout ghcr.io
- name: Create GitHub Release
uses: ncipollo/release-action@v1.14.0
with:
artifacts: "tntconcept-web/target/*.war"
tag: ${{ env.NEXT_RELEASE }}
token: ${{ secrets.GITHUB_TOKEN }}