Skip to content

Commit 8422f20

Browse files
authored
Update gradle.yml
1 parent d9f7f1e commit 8422f20

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ name: Java CI with Gradle
99

1010
on:
1111
push:
12-
branches: [ "master" ]
13-
pull_request:
14-
branches: [ "master" ]
12+
tags:
13+
- '*'
1514

1615

1716
jobs:
@@ -26,12 +25,27 @@ jobs:
2625
uses: gradle/gradle-build-action@v2
2726
- name: Run build with Gradle Wrapper
2827
run: gradle build
29-
env:
30-
USERNAME: ${{secrets.USERNAME}}
31-
TOKEN: ${{secrets.TOKEN}}
32-
RELEASE_VERSION: ${{github.run_number}}
33-
- name: Upload artifacts
34-
uses: actions/upload-artifact@v3
28+
- name: version
29+
run: echo "::set-output name=version::$(./bin/azblogfilter --version)"
30+
id: version
31+
- name: release
32+
uses: actions/create-release@v1
33+
id: create_release
3534
with:
36-
name: build-artifacts
37-
path: build/libs/DiscordBot.jar
35+
draft: false
36+
prerelease: false
37+
release_name: ${{ steps.version.outputs.version }}
38+
tag_name: ${{ github.ref }}
39+
env:
40+
GITHUB_TOKEN: ${{ github.token }}
41+
42+
43+
- name: upload artifact
44+
uses: actions/upload-release-asset@v1
45+
env:
46+
GITHUB_TOKEN: ${{ github.token }}
47+
with:
48+
upload_url: ${{ steps.create_release.outputs.upload_url }}
49+
asset_path: ./build/libs/DiscordBot.jar
50+
asset_name: DiscordBot.jar
51+
asset_content_type: application/java-archive

0 commit comments

Comments
 (0)