Compare commits
2 Commits
main
...
copilot/se
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7104fe0bfe | ||
|
|
89ff540547 |
53
.github/workflows/nightly.yml
vendored
Normal file
53
.github/workflows/nightly.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: Nightly Release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *'
|
||||
workflow_dispatch: {}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
has_commits: ${{ steps.check.outputs.has_commits }}
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Check for commits in the last 24 hours
|
||||
id: check
|
||||
run: |
|
||||
LAST_COMMIT=$(git log -1 --format="%ct")
|
||||
NOW=$(date +%s)
|
||||
DIFF=$((NOW - LAST_COMMIT))
|
||||
# 86400 = seconds in one day
|
||||
if [ "$DIFF" -lt 86400 ]; then
|
||||
echo "has_commits=true" >> $GITHUB_OUTPUT
|
||||
echo "Recent commit found (${DIFF}s ago)"
|
||||
else
|
||||
echo "has_commits=false" >> $GITHUB_OUTPUT
|
||||
echo "No recent commits (last commit was ${DIFF}s ago), skipping nightly release"
|
||||
fi
|
||||
|
||||
- name: Compute nightly version
|
||||
id: version
|
||||
run: |
|
||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||
echo "version=0.0.0-alpha.${SHORT_SHA}" >> $GITHUB_OUTPUT
|
||||
echo "Nightly version: 0.0.0-alpha.${SHORT_SHA}"
|
||||
|
||||
release:
|
||||
needs: prepare
|
||||
if: ${{ needs.prepare.outputs.has_commits == 'true' || github.event_name == 'workflow_dispatch' }}
|
||||
uses: ./.github/workflows/release.yml
|
||||
with:
|
||||
version: ${{ needs.prepare.outputs.version }}
|
||||
extra_tag: latest-dev
|
||||
secrets: inherit
|
||||
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@ -13,6 +13,17 @@ on:
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version number (without v prefix)'
|
||||
required: true
|
||||
type: string
|
||||
extra_tag:
|
||||
description: 'Additional Docker image tag to push (e.g. latest-dev)'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
@ -37,8 +48,8 @@ jobs:
|
||||
id: version
|
||||
run: |
|
||||
# Determine version source
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ github.event.inputs.version }}" ]; then
|
||||
VERSION="${{ github.event.inputs.version }}"
|
||||
if [ -n "${{ inputs.version }}" ]; then
|
||||
VERSION="${{ inputs.version }}"
|
||||
else
|
||||
VERSION="${{ github.ref_name }}"
|
||||
fi
|
||||
@ -153,6 +164,7 @@ jobs:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=v${{ env.VERSION }}
|
||||
type=raw,value=${{ inputs.extra_tag }},enable=${{ inputs.extra_tag != '' }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/digests
|
||||
@ -163,6 +175,10 @@ jobs:
|
||||
- name: Sign the container image
|
||||
run: cosign sign --yes ${{ env.REGISTRY_IMAGE }}:v${{ env.VERSION }}
|
||||
|
||||
- name: Sign the extra tag
|
||||
if: ${{ inputs.extra_tag != '' }}
|
||||
run: cosign sign --yes ${{ env.REGISTRY_IMAGE }}:${{ inputs.extra_tag }}
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:v${{ env.VERSION }}
|
||||
@ -275,6 +291,7 @@ jobs:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=v${{ env.VERSION }}
|
||||
type=raw,value=${{ inputs.extra_tag }},enable=${{ inputs.extra_tag != '' }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/digests-musl
|
||||
@ -285,6 +302,10 @@ jobs:
|
||||
- name: Sign the container image
|
||||
run: cosign sign --yes ${{ env.REGISTRY_IMAGE }}:v${{ env.VERSION }}-musl
|
||||
|
||||
- name: Sign the extra tag
|
||||
if: ${{ inputs.extra_tag != '' }}
|
||||
run: cosign sign --yes ${{ env.REGISTRY_IMAGE }}:${{ inputs.extra_tag }}-musl
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:v${{ env.VERSION }}-musl
|
||||
@ -428,6 +449,7 @@ jobs:
|
||||
images: ${{ env.CONTROLLER_REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=v${{ env.VERSION }}
|
||||
type=raw,value=${{ inputs.extra_tag }},enable=${{ inputs.extra_tag != '' }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: ${{ runner.temp }}/controller-digests
|
||||
@ -438,6 +460,10 @@ jobs:
|
||||
- name: Sign the container image
|
||||
run: cosign sign --yes ${{ env.CONTROLLER_REGISTRY_IMAGE }}:v${{ env.VERSION }}
|
||||
|
||||
- name: Sign the extra tag
|
||||
if: ${{ inputs.extra_tag != '' }}
|
||||
run: cosign sign --yes ${{ env.CONTROLLER_REGISTRY_IMAGE }}:${{ inputs.extra_tag }}
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.CONTROLLER_REGISTRY_IMAGE }}:v${{ env.VERSION }}
|
||||
@ -465,10 +491,12 @@ jobs:
|
||||
IMAGE_REGISTRY: ${{ env.CHART_REGISTRY_IMAGE_BASE }}
|
||||
|
||||
build:
|
||||
if: ${{ github.event_name == 'push' || ! github.event.inputs.skip_gh_release }}
|
||||
if: ${{ github.event_name != 'workflow_call' && (github.event_name == 'push' || ! github.event.inputs.skip_gh_release) }}
|
||||
needs:
|
||||
- setup
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
VERSION: ${{ needs.setup.outputs.version }}
|
||||
strategy:
|
||||
@ -527,7 +555,7 @@ jobs:
|
||||
target/${{ matrix.target }}/release/agentgateway.exe
|
||||
|
||||
release:
|
||||
if: ${{ github.event_name == 'push' || ! github.event.inputs.skip_gh_release }}
|
||||
if: ${{ github.event_name != 'workflow_call' && (github.event_name == 'push' || ! github.event.inputs.skip_gh_release) }}
|
||||
needs:
|
||||
- setup
|
||||
- push-image
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user