Skip to content

Commit

Permalink
Set up release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed May 18, 2024
1 parent 58b743c commit e95f344
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 4 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'create release'

on:
push:
tags:
- '[0-9]+.[0-9]+*'

jobs:
prepare-release:
runs-on: ubuntu-latest

outputs:
tag: ${{ steps.vars.outputs.tag }}
version: ${{ steps.vars.outputs.version }}
upload_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Checkout...
uses: actions/checkout@v4

- name: Set version...
id: vars
run: |
RELEASE_TAG=${GITHUB_REF#refs/*/}
echo ::set-output name=tag::${RELEASE_TAG}
echo ::set-output name=version::${RELEASE_TAG:1}
- name: Create release...
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vars.outputs.tag }}
release_name: ${{ steps.vars.outputs.tag }}
body: JJava ${{ steps.vars.outputs.tag }} release
draft: true
prerelease: false

build-and-upload:
needs: prepare-release
runs-on: ubuntu-latest

steps:
- name: Checkout...
uses: actions/checkout@v4

- name: Set up JDK...
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Build and test...
run: mvn clean verify -U

- name: Upload Archive...
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare-release.outputs.upload_url }}
asset_path: ./target/jjava-${{ needs.prepare-release.outputs.version }}.zip
asset_name: jjava-${{ needs.prepare-release.outputs.version }}.zip
asset_content_type: application/zip
13 changes: 9 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<url>https://github.com/dflib/jjava</url>

<scm>
<connection>scm:git:https://github.com/dflib/jjava</connection>
<developerConnection>scm:git:ssh://[email protected]/dflib/jjava</developerConnection>
<url>https://github.com/dflib/jjava</url>
<tag>HEAD</tag>
<connection>scm:git:https://github.com/m-dzianishchyts/jjava</connection>
<developerConnection>scm:git:ssh://[email protected]/m-dzianishchyts/jjava</developerConnection>
<url>https://github.com/m-dzianishchyts/jjava</url>
<tag>${project.version}</tag>
</scm>

<dependencies>
Expand Down Expand Up @@ -133,6 +133,11 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</build>
</project>

0 comments on commit e95f344

Please sign in to comment.