-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 1.92 KB
/
Copy pathrelease.yml
File metadata and controls
56 lines (53 loc) · 1.92 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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Manual trigger release build
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Next release version"
required: true
default: '1.0.0'
developmentVersion:
description: "Next snapshot version"
required: true
default: '1.0.1-SNAPSHOT'
jobs:
release:
if: github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B verify --file pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git User
run: |
git config --local user.email "sep3tools@github.com"
git config --local user.name "GitHub Actions"
- name: Create Maven Release
run: mvn -Dresume=false -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} -DdeployAtEnd=true -Dgoals=deploy release:prepare release:perform
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/lat-lon/sep3-tools:${{ github.event.inputs.releaseVersion }}