From cb6cb17d4d918c68e9bfb67075d16ec9e21f798c Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 5 May 2020 16:03:52 +0200 Subject: [PATCH] chore(ci) The `publish_jar` job needs code etc. Merge it with `test`. --- .github/workflows/release.yml | 82 ++++++++++++++--------------------- 1 file changed, 32 insertions(+), 50 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a73d041..b197de0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,38 @@ on: - '**' jobs: - test: - name: Test + create_pre_release: + name: Create pre-release + + runs-on: ubuntu-latest + + steps: + # The pre-release must be created only once, hence the split + # into multiple jobs with different `strategy`. + - name: Create a Github pre-release + id: create_pre_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: true + + - name: Output `release_url` into a temporary file + run: echo "${{ steps.create_pre_release.outputs.upload_url }}" > release_url.txt + + - name: Save the `release_url` temporary file + uses: actions/upload-artifact@v1 + with: + name: release_url + path: release_url.txt + + publish_jar: + name: Publish the JARs + + needs: [create_pre_release] strategy: matrix: @@ -61,54 +91,6 @@ jobs: export PATH="$HOME/.cargo/bin:$PATH" make test - create_pre_release: - name: Release - - needs: [test] - - runs-on: ubuntu-latest - - steps: - # The pre-release must be created only once, hence the split - # into multiple jobs with different `strategy`. - - name: Create a Github pre-release - id: create_pre_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: true - - - name: Output `release_url` into a temporary file - run: echo "${{ steps.create_pre_release.outputs.upload_url }}" > release_url.txt - - - name: Save the `release_url` temporary file - uses: actions/upload-artifact@v1 - with: - name: release_url - path: release_url.txt - - publish_jar: - name: Publish the JARs - - needs: [create_pre_release] - - strategy: - matrix: - # The job runs on 3 different OS. - os: [ubuntu-latest, macos-latest, windows-latest] - # The job runs on different Java versions (LTS). - java: [8] - # As soon as one job fails in the matrix, all the other - # in-progress jobs are canceled. - fail-fast: true - - runs-on: ${{ matrix.os }} - - steps: - name: Create the JAR id: create_jar shell: bash