Skip to content

Commit

Permalink
fix: add semver to nightly (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Jul 18, 2024
1 parent 7839b27 commit ec498e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean --skip validate --verbose --config .goreleaser-nightly.yaml
args: release --clean --verbose --config .goreleaser-nightly.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
14 changes: 8 additions & 6 deletions hack/create-nightly-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This script creates and/or updates a nightly tag for the uds-cli repo
# The nightly tag is created from the latest commit on the main branch

tag="0.0.0-nightly"

# get oid and repositoryId for GH API Graphql Mutation
oid=$(gh api graphql -f query='
{
Expand All @@ -26,35 +28,35 @@ repositoryId=$(gh api graphql -f query='
}' | jq -r '.data.repository.id')


# get existing nightly tag and save to existingTag var
# get existing tag and save to existingTag var
existingRefId=$(gh api graphql -f query='
{
repository(owner: "defenseunicorns", name: "uds-cli") {
ref(qualifiedName: "refs/tags/nightly") {
ref(qualifiedName: "refs/tags/'$tag'") {
id
}
}
}' | jq -r '.data.repository.ref.id')

# remove any existing nightly tags
# remove any existing nightly tags
gh api graphql -f query='
mutation DeleteRef {
deleteRef(input:{refId:"'$existingRefId'"}) {
clientMutationId
}
}' --silent &&

echo "Existing nightly tag removed successfully"
echo "Existing '$tag' tag removed successfully"

# create a signed nightly tag
gh api graphql -f query='
mutation CreateRef {
createRef(input:{name:"refs/tags/nightly",oid:"'$oid'",repositoryId:"'$repositoryId'"}) {
createRef(input:{name:"refs/tags/'$tag'",oid:"'$oid'",repositoryId:"'$repositoryId'"}) {
ref {
id
name
}
}
}' --silent &&

echo "New nightly tag created successfully"
echo "New '$tag' tag created successfully"

0 comments on commit ec498e3

Please sign in to comment.