Skip to content

Commit 1de1a7f

Browse files
authored
Merge pull request #15 from m-dzianishchyts/workflows
Enable GitHub Actions #11
2 parents a46ff23 + a3c2425 commit 1de1a7f

File tree

4 files changed

+81
-4
lines changed

4 files changed

+81
-4
lines changed

.github/workflows/maven.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'build test'
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
java: [ 11, 17, 21 ]
16+
17+
steps:
18+
- name: Checkout...
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK...
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ matrix.java }}
25+
distribution: 'temurin'
26+
cache: 'maven'
27+
28+
- name: Build and test...
29+
run: mvn clean verify -U

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'create release'
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+*'
7+
8+
jobs:
9+
prepare-release:
10+
runs-on: ubuntu-latest
11+
12+
outputs:
13+
tag: ${{ steps.vars.outputs.tag }}
14+
version: ${{ steps.vars.outputs.version }}
15+
upload_url: ${{ steps.create_release.outputs.upload_url }}
16+
17+
steps:
18+
- name: Checkout...
19+
uses: actions/checkout@v4
20+
21+
- name: Build and test...
22+
run: mvn clean verify -U
23+
24+
- name: Set version...
25+
id: vars
26+
run: |
27+
RELEASE_TAG=${GITHUB_REF#refs/*/}
28+
echo "tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
29+
echo "version=${RELEASE_TAG}" >> $GITHUB_OUTPUT
30+
31+
- name: Create release...
32+
id: create_release
33+
uses: softprops/action-gh-release@v2
34+
with:
35+
tag_name: ${{ steps.vars.outputs.tag }}
36+
body: JJava ${{ steps.vars.outputs.version }} release
37+
draft: true
38+
prerelease: false
39+
files: ./target/jjava-${{ steps.vars.outputs.version }}.zip
40+
fail_on_unmatched_files: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ target/
44
.project
55
.settings
66
*.iml
7+
release.properties
8+
*.releaseBackup

pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0"
2-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
42
<modelVersion>4.0.0</modelVersion>
53

64
<groupId>org.dflib</groupId>
@@ -25,7 +23,7 @@
2523
<connection>scm:git:https://github.com/dflib/jjava</connection>
2624
<developerConnection>scm:git:ssh://git@github.com/dflib/jjava</developerConnection>
2725
<url>https://github.com/dflib/jjava</url>
28-
<tag>HEAD</tag>
26+
<tag>${project.version}</tag>
2927
</scm>
3028

3129
<dependencies>
@@ -133,6 +131,14 @@
133131
</execution>
134132
</executions>
135133
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-release-plugin</artifactId>
137+
<version>3.0.1</version>
138+
<configuration>
139+
<tagNameFormat>@{project.version}</tagNameFormat>
140+
</configuration>
141+
</plugin>
136142
</plugins>
137143
</build>
138144
</project>

0 commit comments

Comments
 (0)