summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-28 23:45:26 +0800
committerKeuin <[email protected]>2022-10-04 01:50:51 +0800
commite394e795d768f608c0c520a011f3d3627a93f3ab (patch)
tree4bb5ff233abb93e4c6b84a05448f2f482284d9ce /.github
parent34e56ac07249428ae0dd8043f059a30d3784c71b (diff)
Add GitHub action: release
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/release.yml43
1 files changed, 43 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..1e3ba7a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,43 @@
+name: release
+
+on:
+ push:
+ # Sequence of patterns matched against refs/tags
+ tags:
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ if: github.ref != 'refs/heads/master'
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+ - name: Set up JDK
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'adopt'
+ - name: Validate Gradle wrapper
+ uses: gradle/wrapper-validation-action@v1
+ - name: Setup Gradle
+ uses: gradle/gradle-build-action@v2
+ - name: Make gradlew executable
+ run: chmod +x gradlew
+ - name: Gradle build
+ run: ./gradlew build
+ - name: Print directory tree
+ run: find .
+ - name: Gradle test
+ run: ./gradlew test
+ - name: Get version string
+ run: export VERSION=$(echo ${{ github.ref }} | sed 's/-.\+//')
+ - name: Upload binaries to release
+ uses: svenstaro/upload-release-action@v2
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file_glob: true
+ file: build/libs/kbackup-fabric*
+ tag: ${{ env.VERSION }}
+ release_name: ${{ env.VERSION }}
+ prerelease: true \ No newline at end of file