-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (60 loc) · 1.91 KB
/
build.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
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and create release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'adopt'
- name: Checkout CubingPaper
uses: actions/checkout@v4
with:
repository: speedcubing-top/cubingPaper
path: cubingPaper
- name: Install CubingPaper For Maven
run: |
cd cubingPaper
mvn -B install --file pom.xml
- name: Checkout speedcubingLib
uses: actions/checkout@v4
- name: Build speedcubingLib
run: |
mvn -B package --file pom.xml
- name: Upload jar
uses: actions/upload-artifact@v2
with:
name: speedcubingLib
path: cubingPaper/target/speedcubingLib-1.0-SNAPSHOT.jar
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Get commit hash
id: commit
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Create release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.commit.outputs.hash }}
release_name: Release ${{ steps.commit.outputs.hash }}
body: Release ${{ steps.commit.outputs.hash }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cubingPaper/target/speedcubingLib-1.0-SNAPSHOT.jar
asset_name: speedcubingLib-1.0-SNAPSHOT.jar
asset_content_type: application/java-archive