-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (68 loc) · 3.74 KB
/
release.yml
File metadata and controls
83 lines (68 loc) · 3.74 KB
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
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
# Default Java from the container is used.
- uses: gradle/actions/setup-gradle@v4
- id: java-version
run: ./gradlew javaVersion
- uses: madhead/read-java-properties@latest
id: project-version
with:
file: gradle.properties
property: version
- uses: madhead/semver-utils@latest
id: version
with:
version: ${{ steps.project-version.outputs.value }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: >
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }},
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }},
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.major }},
ghcr.io/${{ github.repository }}:latest
build-args: |
JAVA=${{ steps.java-version.outputs.java-version }}
- run: git config user.name "madhead"
- run: git config user.email "siarhei.krukau@gmail.com"
- run: git checkout -b release/${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} ${{ github.sha }}
- run: sed -i 's/docker:\/\/ghcr\.io\/madhead\/read-java-properties:latest/docker:\/\/ghcr.io\/madhead\/read-java-properties:${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}/' action.yml
- run: git add action.yml
- run: git commit --message '${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}'
- run: git tag --force ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}
- run: git checkout -b release/${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }} ${{ github.sha }}
- run: sed -i 's/docker:\/\/ghcr\.io\/madhead\/read-java-properties:latest/docker:\/\/ghcr.io\/madhead\/read-java-properties:${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}/' action.yml
- run: git add action.yml
- run: git commit --message '${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}'
- run: git tag --force ${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
- run: git checkout -b release/${{ steps.version.outputs.major }} ${{ github.sha }}
- run: sed -i 's/docker:\/\/ghcr\.io\/madhead\/read-java-properties:latest/docker:\/\/ghcr.io\/madhead\/read-java-properties:${{ steps.version.outputs.major }}/' action.yml
- run: git add action.yml
- run: git commit --message '${{ steps.version.outputs.major }}'
- run: git tag --force ${{ steps.version.outputs.major }}
- run: git checkout -b release/latest ${{ github.sha }}
- run: git commit --message 'latest' --allow-empty
- run: git tag --force latest
- run: >
git push origin --force
release/${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}
release/${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
release/${{ steps.version.outputs.major }}
release/latest
- run: git push --force --tags origin