diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..a541578 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,21 @@ +name: Create Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Create Release + uses: actions/create-release@v1.0.0 + env: + # https://github.community/t5/GitHub-Actions/Github-Action-trigger-on-release-not-working-if-releases-was/td-p/34559 + GITHUB_TOKEN: ${{ secrets.PAT }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false diff --git a/.github/workflows/publish-binaries.yml b/.github/workflows/publish-binaries.yml index 911d071..1a16f3f 100644 --- a/.github/workflows/publish-binaries.yml +++ b/.github/workflows/publish-binaries.yml @@ -1,6 +1,9 @@ name: Publish Binaries -on: release +on: + release: + types: + - created jobs: publish: @@ -37,13 +40,15 @@ jobs: command: build args: --release --target=${{ matrix.target }} - - name: Archive and compress binary + - name: Package release run: tar -czf ytop-${{ github.event.release.tag_name }}-${{ matrix.target }}.tar.gz -C ./target/${{ matrix.target }}/release/ ytop - - name: Upload archive to GitHub releases - uses: JasonEtco/upload-to-release@master - with: - args: ytop-${{ github.event.release.tag_name }}-${{ matrix.target }}.tar.gz application/zip - + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ytop-${{ github.event.release.tag_name }}-${{ matrix.target }}.tar.gz + asset_name: ytop-${{ github.event.release.tag_name }}-${{ matrix.target }}.tar.gz + asset_content_type: application/zip