forked from MCZbase/DataShot_DesktopApp
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 2.35 KB
/
maven-prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Prerelease Publisher
on:
push:
branches: [ master ]
tags-ignore:
- 'v*' # do not run on tags, as we run the full publish then
paths-ignore:
- 'bin/'
- 'docs_manual/'
- '.github/'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 12
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
# without -DskipTests, we also run tests, which should prevent
# the package from being packaged if tests fail
run: mvn -B package --file pom.xml -P dist
- name: Determine Prerelease Name
id: name_determiner
run: echo "##[set-output name=name;]DataShot-$(date +'%Y%m%d-%H%M')-beta"
- name: Create Pre-release
id: create_prerelease
if: success()
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: untagged-${{ steps.name_determiner.outputs.name }}-${{ github.sha }}
release_name: ${{ steps.name_determiner.outputs.name }}
body: "Momentary Snapshot Version. Refer to the git history, [commit log](https://github.com/BernhardWebstudio/DataShot_DesktopApp/commits/master) for current changes"
draft: false
prerelease: true
- name: Upload Pre-release
id: upload_prerelease
if: success()
#uses: actions/upload-release-asset@v1
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#with:
# 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
# asset_path: ./my-artifact.zip
# asset_name: my-artifact.zip
# asset_content_type: application/zip
uses: csexton/release-asset-action@v2
with:
pattern: "target/DataShot*.jar"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ steps.create_prerelease.outputs.upload_url }}