Add .forgejo/workflows/build.yaml
Some checks are pending
Build&Release / build_and_release (push) Waiting to run
Some checks are pending
Build&Release / build_and_release (push) Waiting to run
This commit is contained in:
parent
2da3ecf83b
commit
6b98796d6b
1 changed files with 47 additions and 0 deletions
47
.forgejo/workflows/build.yaml
Normal file
47
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,47 @@
|
|||
name: Build&Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build_and_release:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '21'
|
||||
|
||||
- name: Cache Maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn clean install -DskipTests
|
||||
|
||||
- name: Run tests
|
||||
run: mvn test
|
||||
|
||||
- name: Prepare release
|
||||
run: mvn release:prepare -DreleaseVersion=1.0.0 -DdevelopmentVersion=1.1.0-SNAPSHOT -DpushChanges=false
|
||||
|
||||
- name: Perform release
|
||||
run: mvn release:perform
|
||||
|
||||
- name: Publish release (optional)
|
||||
run: |
|
||||
git tag v1.0.0
|
||||
git push origin v1.0.0
|
Loading…
Add table
Add a link
Reference in a new issue