-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1706-add-shellcheck
- Loading branch information
Showing
15 changed files
with
272 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Nightlies | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 | ||
with: | ||
egress-policy: audit | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | ||
|
||
- name: Use Node.js 20 | ||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | ||
with: | ||
node-version: 20 | ||
registry-url: "https://registry.npmjs.org" | ||
cache: "npm" | ||
|
||
- name: "Pepr Controller: Login to GHCR" | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | ||
with: | ||
registry: ghcr.io | ||
username: dummy | ||
password: ${{ github.token }} | ||
|
||
- name: Publish to GHCR and NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: ./scripts/nightlies.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2023-Present The Pepr Authors | ||
|
||
# Script to build and publish nightly versions of Pepr Controller and Pepr CLI. | ||
|
||
set -e | ||
npm install -g npm | ||
|
||
LATEST_VERSION=$(npx --yes pepr@latest --version 2>/dev/null) | ||
RAW_NIGHTLY_VERSION=$(npx --yes pepr@nightly --version 2>/dev/null || echo "none") | ||
|
||
if [[ "$RAW_NIGHTLY_VERSION" == "none" ]]; then | ||
echo "No nightly version found. Setting NIGHTLY_VERSION=0." | ||
NIGHTLY_VERSION=0 | ||
else | ||
NIGHTLY_VERSION_PART=$(echo "$RAW_NIGHTLY_VERSION" | grep -oE "nightly\.([0-9]+)" | cut -d. -f2) | ||
|
||
BASE_NIGHTLY_VERSION=${RAW_NIGHTLY_VERSION%-nightly*} | ||
if [[ "$LATEST_VERSION" > "$BASE_NIGHTLY_VERSION" ]]; then | ||
echo "Nightly version is less than the latest version. Resetting NIGHTLY_VERSION to 0." | ||
NIGHTLY_VERSION=0 | ||
else | ||
NIGHTLY_VERSION=$((NIGHTLY_VERSION_PART + 1)) | ||
echo "Incrementing NIGHTLY_VERSION to $NIGHTLY_VERSION." | ||
fi | ||
fi | ||
|
||
FULL_VERSION="${LATEST_VERSION}-nightly.${NIGHTLY_VERSION}" | ||
|
||
echo "FULL_VERSION=$FULL_VERSION" >> "$GITHUB_ENV" | ||
|
||
npm version --no-git-tag-version "$FULL_VERSION" | ||
|
||
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/defenseunicorns/pepr/controller:v"$FULL_VERSION" . | ||
|
||
npm install | ||
npm run build | ||
|
||
npm publish --tag "nightly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.