Skip to content

Commit

Permalink
Merge pull request #12 from loftwah/dl/cd-fix6
Browse files Browse the repository at this point in the history
keep failing
  • Loading branch information
loftwah authored Sep 3, 2024
2 parents 3cf9e92 + 8dabcef commit 113f1a0
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CD
on:
push:
branches:
- main # Automatically triggers on every push to the main branch
workflow_dispatch: # Allows manual triggering
- main
workflow_dispatch:

permissions:
contents: write # Required for creating releases and uploading assets
contents: write

jobs:
release:
Expand All @@ -17,9 +17,11 @@ jobs:
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
check-latest: true
cache: true

- name: Build
run: |
Expand All @@ -36,9 +38,10 @@ jobs:
- name: Create Tag
id: create_tag
run: |
TAG="v1.0.$(date +'%s')" # Generates a unique tag based on the current timestamp
git config --global user.email "[email protected]" # Set your GitHub email
git config --global user.name "loftwah" # Set your GitHub username
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:
Expand All @@ -47,7 +50,12 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.create_tag.outputs.TAG }} # Uses the newly created tag
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
Expand All @@ -56,4 +64,4 @@ jobs:
grabitsh-darwin-amd64.sha256
grabitsh-windows-amd64.exe.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 113f1a0

Please sign in to comment.