Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Commit 7a2fe8b

Browse files
committed
add fancy workflows
1 parent a5e5287 commit 7a2fe8b

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
7+
steps:
8+
- uses: actions/checkout@v3
9+
10+
- name: Set up JDK 17
11+
uses: actions/setup-java@v3
12+
with:
13+
java-version: '17'
14+
distribution: 'temurin'
15+
16+
- name: Cache the Maven packages to speed up build
17+
uses: actions/cache@v1
18+
with:
19+
path: ~/.m2
20+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
21+
restore-keys: ${{ runner.os }}-m2
22+
23+
- name: Build with Maven
24+
run: mvn -B package --file pom.xml
25+
26+
- name: Archive Jar Artifacts
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: ${{ github.event.repository.name }}.jar
30+
path: target/Linky.jar
31+
retention-days: 3

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Release
2+
on:
3+
workflow_run:
4+
workflows: ["Build"]
5+
branches: [ main ]
6+
types:
7+
- completed
8+
9+
permissions: write-all
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Download Jar
16+
uses: dawidd6/action-download-artifact@v2
17+
with:
18+
workflow: build.yml
19+
name: ${{ github.event.repository.name }}.jar
20+
path: target/Linky.jar
21+
22+
- name: Create Release
23+
uses: marvinpinto/action-automatic-releases@latest
24+
with:
25+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
26+
automatic_release_tag: "latest"
27+
prerelease: false
28+
title: "Release"
29+
files: ./target/Linky.jar

0 commit comments

Comments
 (0)