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

Commit ffe24cd

Browse files
Add release workflow
1 parent 7eb589c commit ffe24cd

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up JDK 11
12+
uses: actions/setup-java@v1
13+
with:
14+
java-version: 11
15+
- name: Grant execute permission for gradlew
16+
run: chmod +x gradlew
17+
- name: Build with Gradle
18+
run: ./gradlew build
19+
- name: Extract version
20+
shell: bash
21+
run: echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3)
22+
id: extract_version
23+
- name: Create Release
24+
id: create_release
25+
uses: actions/create-release@latest
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
28+
with:
29+
tag_name: ${{ steps.extract_version.outputs.version }}
30+
release_name: Release ${{ steps.extract_version.outputs.version }}
31+
body: "Release ${{ steps.extract_version.outputs.version }}"
32+
draft: false
33+
prerelease: false
34+
- name: Upload Release Asset
35+
id: upload-release-asset
36+
uses: actions/upload-release-asset@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
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
41+
asset_path: ./build/libs/bonitasoft-gdrive-upload.hpi
42+
asset_name: bonitasoft-gdrive-upload.hpi
43+
asset_content_type: application/zip

0 commit comments

Comments
 (0)