Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
airycanon committed May 14, 2024
1 parent 5e370cc commit da61d0b
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- v*
jobs:
test:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -25,44 +25,22 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go test -v ./...
- run: ./test.sh

release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
id: go

- name: Cache Go Modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
if ${{github.event_name == 'workflow_dispatch'}}; then
VERSION=$(git describe --abbrev=0 --tags)
fi
echo ::set-output name=VERSION::${VERSION}
echo "VERSION=${VERSION}" >> $GITHUB_STATE
- name: Get the build date
id: get_build_date
run: echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down

0 comments on commit da61d0b

Please sign in to comment.