Merge pull request #14 from loftwah/dl/handle-bigger-repos #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
check-latest: true | |
cache: true | |
- name: Build | |
run: | | |
go build -v -o grabitsh-linux-amd64 | |
GOOS=darwin GOARCH=amd64 go build -v -o grabitsh-darwin-amd64 | |
GOOS=windows GOARCH=amd64 go build -v -o grabitsh-windows-amd64.exe | |
- name: Generate SHA256 | |
run: | | |
sha256sum grabitsh-linux-amd64 > grabitsh-linux-amd64.sha256 | |
sha256sum grabitsh-darwin-amd64 > grabitsh-darwin-amd64.sha256 | |
sha256sum grabitsh-windows-amd64.exe > grabitsh-windows-amd64.exe.sha256 | |
- name: Create Tag | |
id: create_tag | |
run: | | |
TAG="v1.0.$(date +'%Y%m%d%H%M%S')" | |
echo "NEW_TAG=$TAG" >> $GITHUB_OUTPUT | |
git config --global user.email "[email protected]" | |
git config --global user.name "loftwah" | |
git tag $TAG | |
git push origin $TAG | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.create_tag.outputs.NEW_TAG }} | |
name: Release ${{ steps.create_tag.outputs.NEW_TAG }} | |
body: | | |
Automated release for version ${{ steps.create_tag.outputs.NEW_TAG }} | |
Please refer to the commit history for changes in this release. | |
files: | | |
grabitsh-linux-amd64 | |
grabitsh-darwin-amd64 | |
grabitsh-windows-amd64.exe | |
grabitsh-linux-amd64.sha256 | |
grabitsh-darwin-amd64.sha256 | |
grabitsh-windows-amd64.exe.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |