Skip to content

Commit

Permalink
changed release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-kuba committed Jan 11, 2023
1 parent 1e19e66 commit 42a4272
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/release_assets.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: "upload release assets"
on:
release:
types: [ 'created' ]
push:
# Run for tagged commits, the tag name should be X.Y.Z to be used as version in pom.xml
tags:
- '[1-9]*'
jobs:
build:
publish:
name: "create release with assets"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "check out code"
uses: actions/checkout@v3
Expand All @@ -16,16 +21,13 @@ jobs:
java-version: 17
cache: 'maven'

- name: "compile and package"
run: mvn -B clean package
- name: "set version from tag in all pom.xml to $GITHUB_REF_NAME"
run: "mvn versions:set -DnewVersion=$GITHUB_REF_NAME ; mvn versions:commit"

- name: "upload jar as a release asset"
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "compile and build package"
run: mvn -B clean install

- name: "create release and upload assets"
uses: ncipollo/release-action@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./chat-server/target/chat_service.jar
asset_name: chat_service.jar
asset_content_type: application/java-archive
artifacts: "chat-server/target/chat_service.jar,chat-client-java-lib/target/chat-client-java-lib.jar"
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
cache: 'maven'

- name: "build and test with Maven"
run: mvn -B clean test
run: mvn -B clean install

2 changes: 1 addition & 1 deletion chat-client-java-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.1.0</version>
<version>0.0.0-SNAPSHOT</version>
</parent>

<!-- this module definition -->
Expand Down
2 changes: 1 addition & 1 deletion chat-client-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.1.0</version>
<version>0.0.0-SNAPSHOT</version>
</parent>

<!-- this module definition -->
Expand Down
2 changes: 1 addition & 1 deletion chat-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.1.0</version>
<version>0.0.0-SNAPSHOT</version>
</parent>

<!-- this module definition -->
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cz.muni.chat</groupId>
<artifactId>chat-service-parent</artifactId>
<version>1.1.0</version>
<version>0.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Chat service parent project</name>
Expand Down

0 comments on commit 42a4272

Please sign in to comment.