From cf1f883ba48c8b12deefe099af0ca5350b1db822 Mon Sep 17 00:00:00 2001 From: Oleksandr Kolomoiets <0985305543@ukr.net> Date: Sun, 28 May 2023 02:19:42 +0300 Subject: [PATCH] Adjusted releaser.xml --- .github/workflows/releaser.yml | 71 +++++++++++++--------------------- 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index e49d48e..5ebfd4e 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -22,11 +22,6 @@ jobs: with: go-version: 1.20.0 - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - - name: Build for Linux run: GOOS=linux GOARCH=amd64 go build -o linkchecker ./cmd/linkchecker env: @@ -37,47 +32,35 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get previous release - id: prev_release - uses: "marvinpinto/action-automatic-releases@latest" + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Fetch commit history - id: commit_history - run: | - git fetch --unshallow --tags - PREVIOUS_RELEASE_TAG=${{ steps.prev_release.outputs.tag_name }} - git log --pretty=format:"- %s [%h](https://github.com/${{ github.repository }}/commit/%H)" $PREVIOUS_RELEASE_TAG..HEAD > changelog.txt - echo "::set-output name=changelog::$(cat changelog.txt)" - - - name: Generate Changelog - id: changelog - run: | - PREVIOUS_RELEASE_BODY=${{ steps.prev_release.outputs.release_body }} - COMMIT_HISTORY=${{ steps.commit_history.outputs.changelog }} - NEW_RELEASE_BODY="${PREVIOUS_RELEASE_BODY} - - ### Changelog - ${COMMIT_HISTORY}" - echo "::set-output name=new_body::$NEW_RELEASE_BODY" + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false - - name: Create Release for Linux - uses: "marvinpinto/action-automatic-releases@latest" + - name: Upload Release Asset (Linux) + id: upload-release-asset-linux + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - files: ./linkchecker - prerelease: false - body: ${{ steps.changelog.outputs.new_body }} - tag_name: v${{ steps.prev_release.outputs.tag_name }} - release_name: Release ${{ steps.prev_release.outputs.tag_name }} for Linux + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./linkchecker + asset_name: linkchecker + asset_content_type: application/octet-stream - - name: Create Release for Windows - uses: "marvinpinto/action-automatic-releases@latest" + - name: Upload Release Asset (Windows) + id: upload-release-asset-windows + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - files: ./linkchecker.exe - prerelease: false - body: ${{ steps.changelog.outputs.new_body }} - tag_name: v${{ steps.prev_release.outputs.tag_name }} - release_name: Release ${{ steps.prev_release.outputs.tag_name }} for Windows + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./linkchecker.exe + asset_name: linkchecker.exe + asset_content_type: application/octet-stream