Skip to content

Commit

Permalink
Merge pull request #4 from luxuriant777/dev
Browse files Browse the repository at this point in the history
Adjusted releaser.xml
  • Loading branch information
Alexander Kolomoets authored May 27, 2023
2 parents e8371d7 + cf1f883 commit d4e2035
Showing 1 changed file with 27 additions and 44 deletions.
71 changes: 27 additions & 44 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit d4e2035

Please sign in to comment.