From e2dcf4b12053fb62be68f2010c840157720abecf Mon Sep 17 00:00:00 2001 From: Benoni Jiang Date: Sun, 25 Oct 2020 23:45:11 +0800 Subject: [PATCH] modify gradle.yml --- .github/workflows/gradle.yml | 40 +++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 75914b1..3300c2e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -3,11 +3,17 @@ name: Java CI with Gradle +#on: +# push: +# branches: [ master ] +# pull_request: +# branches: [ master ] on: push: - branches: [ master ] - pull_request: - branches: [ master ] + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + jobs: build: @@ -24,7 +30,27 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew release - - uses: actions/upload-artifact@v2 - with: - name: openTCS-4.18.0-SNAPSHOT-bin - path: build/distributions/openTCS-4.18.0-SNAPSHOT-bin.zip +# - uses: actions/upload-artifact@v2 +# with: +# name: openTCS-4.18.0-SNAPSHOT-bin +# path: build/distributions/openTCS-4.18.0-SNAPSHOT-bin.zip + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + 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/distributions/openTCS-4.18.0-SNAPSHOT-bin.zip + asset_name: openTCS-4.18.0-SNAPSHOT-bin.zip + asset_content_type: application/zip \ No newline at end of file