-
-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (68 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
name: Publish Image to Docker
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '23'
distribution: 'temurin'
cache: maven
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Write release version
run: VERSION=${GITHUB_REF_NAME#v}; echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set release version POMs
run: ./mvnw --no-transfer-progress --batch-mode --strict-checksums versions:set -DnewVersion=${VERSION}
- name: Set release version package.json
working-directory: naikan-client
run: npm version ${VERSION}
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Perform release ${{ env.VERSION }}
- name: Maven package
run: ./mvnw --no-transfer-progress --batch-mode --strict-checksums clean package
- name: Docker build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
enofex/naikan:${{ env.VERSION }}
enofex/naikan:latest
labels: |
org.opencontainers.image.title=Naikan
org.opencontainers.image.description=Naikan is a software inventory management tool for your dev teams driven by our CI/CD pipeline.
org.opencontainers.image.vendor=Enofex
org.opencontainers.image.version=${{ env.VERSION }}
org.opencontainers.image.url=https://enofex.com
org.opencontainers.image.source=https://github.com/enofex/naikan
org.opencontainers.image.licenses=MIT license
- name: Set next version POMs
run: ./mvnw --no-transfer-progress --batch-mode --strict-checksums build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- name: Set next version package.json
working-directory: naikan-client
run: npm run-script sync-pom-version
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: Prepare for next release
tags: true