Skip to content

Nightly Release

Nightly Release #60

name: Nightly Release
# Creates a nightly release and builds and uploads `astria-go` binaries.
# NOTE - releases created via automation don't trigger actions that should
# trigger on release creation, e.g. build-for-release, so we have to have a
# build step in this workflow as well.
# see: https://github.com/orgs/community/discussions/25281
on:
schedule:
# every day at 6AM UTC. late night for America, early morning for Europe
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
create-nightly-release:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.set_envars.outputs.TAG_NAME }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set envars
id: set_envars
run: |
# generate TAG_NAME and RELEASE_DATE envars
TODAY=$(date +'%Y-%m-%d')
echo "RELEASE_DATE=$TODAY" >> "$GITHUB_OUTPUT"
echo "TAG_NAME=nightly-$TODAY" >> "$GITHUB_OUTPUT"
- name: Create Nightly Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: "Nightly Release ${{ steps.set_envars.outputs.RELEASE_DATE }}"
body: "${{ steps.set_envars.outputs.RELEASE_DATE }} nightly release of `astria-go`"
tag_name: ${{ steps.set_envars.outputs.TAG_NAME }}
prerelease: true
draft: false
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
build-and-upload:
needs: create-nightly-release
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux, darwin ]
goarch: [ amd64, arm64 ]
exclude:
- goarch: "arm64"
goos: "linux"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build and Upload Nightly Release
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: >
-s -w -X github.com/astriaorg/astria-cli-go/modules/cli/cmd.version=${{ needs.create-nightly-release.outputs.tag_name }}
project_path: "./modules/cli"
binary_name: "astria-go"
release_tag: ${{ needs.create-nightly-release.outputs.tag_name }}