Skip to content

Client Tools nightly build #966

Client Tools nightly build

Client Tools nightly build #966

Workflow file for this run

name: Client Tools nightly build
on:
workflow_dispatch:
inputs:
nightly-id:
description: "ID to use for the build in place of YYYYMMDD"
required: true
type: string
schedule:
- cron: "33 4 * * *"
# 2022-08-08: want this to run again soon, so moved from "33 2" to "33 4", can be reverted any time after this
permissions:
# Control the GITHUB_TOKEN permissions.
# By having this block, all permissions not listed here are set to none.
# Available permissions listed at:
# <https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token>
# Which API calls need which permissions at what level, listed at:
# <https://docs.github.com/en/rest/reference/permissions-required-for-github-apps>
#
contents: read
jobs:
nightly_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# NB: the `fetch-depth: 0` setting is documented by goreleaser
# as a requirement, for the changelog feature to work correctly.
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
# This should be quoted or use .x, but should not be unquoted.
# Remember that a YAML bare float drops trailing zeroes.
go-version: '1.22'
check-latest: true
# As of v3 of this action, we could also use `go-version-file: # go.mod`
# and get the version from there, but that is semantically wrong: the
# version in the go.mod is the version of the compiler we're
# compatible to, and might often be one version behind current.
- name: Install GoReleaser
id: goreleaser-install
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
# 2024-06-05: goreleaser v2 is out, and makes deprecations fatal.
# Our build-nightlies.sh invokes goreleaser in the repos for the nsc
# and natscli tools, so we can't update until both of those are
# deprecation-free under v1.26.2
version: "~> v1"
install-only: true
- name: Install cosign
id: cosign-install
uses: sigstore/cosign-installer@main
# As of actions/setup-go@v4, go modules and build outputs are cached by default.
# Prior to the update to use that, we used actions/cache@v3 here for a step:
# name: Setup caching of Go modules and packages
- name: Run nightlies build-and-release tool (if scheduled)
id: build-cron
if: ${{ github.event_name == 'schedule' }}
run: |
./build-nightlies.sh
env:
CLOUDFLARE_AUTH_TOKEN: ${{ secrets.CLOUDFLARE_AUTH_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NIGHTLY_SIGNING_KEY_COSIGN: ${{ secrets.NIGHTLY_SIGNING_KEY_COSIGN }}
NIGHTLY_SIGNING_KEY_SSH: ${{ secrets.NIGHTLY_SIGNING_KEY_SSH }}
- name: Run manual build-and-release tool (if manual trigger)
id: build-manual
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
./build-nightlies.sh
env:
CLOUDFLARE_AUTH_TOKEN: ${{ secrets.CLOUDFLARE_AUTH_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NIGHTLY_SIGNING_KEY_COSIGN: ${{ secrets.NIGHTLY_SIGNING_KEY_COSIGN }}
NIGHTLY_SIGNING_KEY_SSH: ${{ secrets.NIGHTLY_SIGNING_KEY_SSH }}
#
NIGHTLY_DATE: ${{ github.event.inputs.nightly-id }}
# NB: IF ADDING HERE, PROBABLY ALSO ADD TO 'schedule' INVOCATION ABOVE
report_build_failure:
if: failure()
runs-on: ubuntu-latest
permissions: {}
needs: [nightly_release]
steps:
- name: Notify Synadia Communications Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_SYNADIA_BUILDS_GITHUB }}
SLACK_USERNAME: "client-tools-nightlies-builder"
SLACK_ICON_EMOJI: ":moon:"
SLACK_COLOR: "#FF0000"
SLACK_MESSAGE: "client-tools nightly release build failed"