Skip to content

Nightly release #1386

Nightly release

Nightly release #1386

Workflow file for this run

name: Nightly release
on:
schedule:
- cron: "10 0 * * *"
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: v2
fetch-depth: 0 # it is required for the changelog to work correctly.
- name: Set env
run: |
git fetch --tags
full=$(git describe --abbrev --tags --always)
version=$(echo "$full" | cut -d- -f1)
rev=$(echo "$full" | cut -d- -f2- | sha1sum | cut -d' ' -f1)
echo "NIGHTLY_VERSION=${version}-nightly-${rev}" >> $GITHUB_ENV
- name: Check for same revision exists
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set +e
gh release list | grep "${{ env.NIGHTLY_VERSION }}"
if [ $? -eq 0 ]; then
echo "${{ env.NIGHTLY_VERSION }} already exists"
else
echo "DO_RELEASE=true" >> $GITHUB_ENV
git tag "${{ env.NIGHTLY_VERSION }}"
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.DO_RELEASE }}