Skip to content

Commit

Permalink
add fix for nightly workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Soule BA <[email protected]>
  • Loading branch information
souleb committed Oct 25, 2023
1 parent 18d85fe commit ac27160
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/nightly_v21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ssh-key: "${{ secrets.NIGHTLY_BUILD_KEY }}"
fetch-depth: 0
- name: Push nightly tag
shell: bash
run: |
git config --global user.name "Soule BA"
git config --global user.email "[email protected]"
# Get the latest release tag
git fetch 'refs/tags/*:refs/tags/*'
DESCRIBE=$(git tag -l --sort=-v:refname | grep -v nightly | head -n 1)
MAJOR_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}')
MINOR_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}')
PATCH_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[3]}')
PATCH_NUMBER=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[4]}')
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}"
if [[ "$PATCH_NUMBER" =~ ^[0-9]+$ ]]; then
TAG="${TAG}.${PATCH_NUMBER}"
fi
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release_v21.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: version
shell: bash
run: |
if [[ "{{ github.ref_name }}" == "*.nightly*" ]]; then
if [[ "${{ github.ref }}" == refs/tags/v*.nightly* ]]; then
echo "nightly=true" >> $GITHUB_OUTPUT
else
echo "nightly=false" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -212,12 +212,14 @@ jobs:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
needs: [sc-ghcr-provenance, kc-ghcr-provenance, hc-ghcr-provenance, irc-ghcr-provenance, iac-ghcr-provenance, nc-ghcr-provenance]
needs: [nightly-tag,sc-ghcr-provenance, kc-ghcr-provenance, hc-ghcr-provenance, irc-ghcr-provenance, iac-ghcr-provenance, nc-ghcr-provenance]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Kustomize
uses: fluxcd/pkg/actions/kustomize@main
- name: Setup yq
uses: fluxcd/pkg/actions/yq@main
- name: install stgit
shell: bash
run: |
Expand Down Expand Up @@ -257,6 +259,8 @@ jobs:
fi
if [[ "${{ needs.nightly-tag.outputs.nightly }}" == "true" ]]; then
VERSION=${VERSION}-nightly.$(date +%y%m%d%H%M%S)
# also patch .goreleaser.yml
yq -i '.release.make_latest = false' .goreleaser.yml
else
VERSION=${VERSION}.$(date +%y%m%d%H%M%S)
fi
Expand Down Expand Up @@ -342,7 +346,7 @@ jobs:
release-flux-manifests:
runs-on: ubuntu-latest
needs: release-flux-cli
needs: [nightly-tag, release-flux-cli]
permissions:
id-token: write
packages: write
Expand Down
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ sboms:
documents:
- "{{ .ProjectName }}_{{ .Version }}_sbom.spdx.json"
release:
make_latest: true
extra_files:
- glob: output/crd-schemas.tar.gz
- glob: output/manifests.tar.gz
- glob: output/install.yaml

changelog:
skip: true

checksum:
extra_files:
- glob: output/crd-schemas.tar.gz
Expand Down

0 comments on commit ac27160

Please sign in to comment.