Skip to content

Commit

Permalink
feat(ci): add nightly releases (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd authored Aug 7, 2024
1 parent b8aae8a commit d523a64
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Ttle
name: PR Title and Commit Lint

on:
pull_request:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nightly Release
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *" ## nightly at 3am UTC

permissions:
contents: read

jobs:
test:
uses: ./.github/workflows/pr-tests.yaml

push:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-tags: 'true'

- name: Login to GHCR
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Publish
run: |
uds run build:publish-uds-runtime --set REF=nightly-unstable --set DIR=hack
- name: Update nightly-unstable tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
working-directory: hack
run: |
# cleanup old release
gh release delete nightly-unstable --cleanup-tag -y || true
# generate new release
gh release create nightly-unstable ./build/zarf-package-uds-runtime-* \
-t "nightly-unstable" \
--prerelease \
-n 'Nightly unstable build'
5 changes: 3 additions & 2 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: PR
name: PR Tests
on:
workflow_call:
pull_request:
branches: [main]
types: [milestoned, opened, edited, synchronize]
Expand Down Expand Up @@ -32,7 +33,7 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
- name: Setup Environment (Go, Node, Homebrew, UDS CLI, k3d)
uses: ./.github/actions/setup

- name: Run tests
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ node_modules
.output
.vercel
/ui/.svelte-kit
/ui/build
/build
**/build/

# OS
.DS_Store
Expand Down
16 changes: 16 additions & 0 deletions hack/zarf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: ZarfPackageConfig
metadata:
name: uds-runtime
description: nightly release of uds-runtime
version: nightly-unstable

components:
- name: uds-runtime
required: true
images:
- ghcr.io/defenseunicorns/uds-runtime:nightly-unstable
charts:
- name: uds-runtime
localPath: ../chart
namespace: uds-runtime
version: 0.1.0
1 change: 0 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"release-type": "simple",
"bump-minor-pre-major": true,
"draft": false,
"release-as": "0.1.0",
"changelog-path": "CHANGELOG.md",
"changelog-sections": [
{ "type": "feat", "section": "Features", "hidden": false },
Expand Down
3 changes: 3 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ variables:
# x-release-please-start-version
default: 0.1.0
# x-release-please-end
- name: DIR
description: "directory of the zarf.yaml"
default: .

tasks:
- name: dev-server
Expand Down
7 changes: 7 additions & 0 deletions tasks/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ variables:
# x-release-please-start-version
default: 0.1.0
# x-release-please-end
- name: DIR
description: "directory of the zarf.yaml"
default: .

tasks:
- name: publish-uds-runtime
Expand All @@ -31,10 +34,14 @@ tasks:
description: "build the uds runtime zarf packages (multi-arch)"
actions:
- cmd: ./uds zarf p create --set REF=${REF} -a amd64 -o build --confirm
dir: ${DIR}
- cmd: ./uds zarf p create --set REF=${REF} -a arm64 -o build --confirm
dir: ${DIR}

- name: publish-zarf-packages
description: "publish uds runtime zarf packages (multi-arch)"
actions:
- cmd: ./uds zarf p publish build/zarf-package-uds-runtime-amd64-${REF}.tar.zst oci://ghcr.io/defenseunicorns/packages/uds
dir: ${DIR}
- cmd: ./uds zarf p publish build/zarf-package-uds-runtime-arm64-${REF}.tar.zst oci://ghcr.io/defenseunicorns/packages/uds
dir: ${DIR}

0 comments on commit d523a64

Please sign in to comment.