Skip to content

Commit 974800a

Browse files
committed
changed publishing a package to uploading a release asset
1 parent 183cbd3 commit 974800a

File tree

3 files changed

+50
-30
lines changed

3 files changed

+50
-30
lines changed

.github/workflows/maven.yml

-29
This file was deleted.

.github/workflows/release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# from https://github.com/actions/upload-release-asset
2+
name: "Make a release"
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
publish:
11+
name: "Build and upload release asset"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: "Check out code"
15+
uses: actions/checkout@v2
16+
- name: "Set up JDK"
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
- name: "Cache"
21+
uses: actions/cache@v1
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
${{ runner.os }}-maven-
27+
- name: "Compile and package"
28+
run: mvn -B clean package
29+
- name: "Create Release"
30+
id: create_release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ github.ref }}
36+
release_name: Release ${{ github.ref }}
37+
draft: false
38+
prerelease: false
39+
- name: "Upload Release Asset"
40+
id: upload-release-asset
41+
uses: actions/upload-release-asset@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
46+
asset_path: ./target/fake_oidc_server.jar
47+
asset_name: fake_oidc_server.jar
48+
asset_content_type: application/java-archive

pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</parent>
1010
<groupId>cz.metacentrum</groupId>
1111
<artifactId>fake_oidc</artifactId>
12-
<version>1.1.1</version>
12+
<version>1.1.2</version>
1313
<name>fake_oidc</name>
1414
<description>Fake OpenId Connect Authorization Server</description>
1515

@@ -43,6 +43,7 @@
4343
</dependencies>
4444

4545
<build>
46+
<finalName>fake_oidc_server</finalName>
4647
<plugins>
4748
<plugin>
4849
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)