-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (68 loc) · 2.6 KB
/
publish.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
name: publish
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 14
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.4.1
arguments: build
- uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Generate changelog
id: changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
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: build/libs/herbocraft-dev.jar
asset_name: herbocraft-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/java-archive
- name: Upload
uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.4.1
arguments: curseforge
env:
CURSEFORGE_API_KEY: ${{ secrets.PUBLISH_KEY }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
CHANGELOG: ${{ steps.changelog.outputs.changelog }}