From d0af0b6e368fb16bf619f4f7acb31638e644f28e Mon Sep 17 00:00:00 2001 From: Matthew Casperson Date: Fri, 11 Oct 2019 09:38:01 +1000 Subject: [PATCH] Creating releases via tags --- .github/workflows/release.yaml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..a19c3a44 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,41 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Upload Release Asset + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Set up JDK 13 + uses: actions/setup-java@v1 + with: + java-version: 13 + - name: Build with Maven + run: mvn package -DskipTests + - name: Create Release + id: create_release + uses: actions/create-release@v1.0.0 + 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.0.0 + 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: ./target/webdrivertraining-1.0-SNAPSHOT.jar + asset_name: webdrivertraining.jar + asset_content_type: application/java-archive \ No newline at end of file