From 941190bf601362c54edbfaa88a79e0a77d35f822 Mon Sep 17 00:00:00 2001 From: Louis Bailleau Date: Wed, 16 Aug 2023 11:01:38 +0200 Subject: [PATCH] ci: fix artifacts not uploaded --- .github/workflows/build-project.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 113a966..fe48e20 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -48,7 +48,6 @@ jobs: {{__unknown__}} build: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v3 @@ -65,13 +64,14 @@ jobs: arguments: build - name: Rename artifact to use tag as version - if: startsWith(github.ref, 'refs/heads/v') + if: startsWith(github.ref, 'refs/tags/v') run: | mv build/libs/*.jar build/libs/archivist-${{github.ref_name}}.jar - name: Upload artifact uses: actions/upload-artifact@v2 - if: startsWith(github.ref, 'refs/heads/v') + if: startsWith(github.ref, 'refs/tags/v') + id: artifact with: name: artifact path: build/libs/*.jar @@ -90,15 +90,28 @@ jobs: with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} - draft: false + draft: true body: | ${{ steps.changelog.outputs.compareurl }} ${{ steps.changelog.outputs.changelog }} - - - name: Upload artifact - uses: actions/upload-artifact@v2 + - uses: actions/download-artifact@master with: name: artifact path: build/libs/*.jar + + - uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/libs/*.jar + asset_name: archivist-${{github.ref_name}}.jar + asset_content_type: application/java-archive + + - uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }}