Skip to content

Commit

Permalink
Fix main branch building with no version.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed May 31, 2023
1 parent f323ae6 commit f7ee2d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,29 @@ jobs:
- name: Build
run: |
export VERSION=`echo $GITHUB_REF | sed -e "s/refs\/heads\///g" -e "s/release\/\|main//g"`
export VERSION="v${VERSION}.$GITHUB_RUN_NUMBER"
export VERSION="v${VERSION:-0.0}.${GITHUB_RUN_NUMBER:-0}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "GORELEASER_CURRENT_TAG=${VERSION}" >> $GITHUB_ENV
# sed -i "s/0.0.0/${VERSION}/g" src/version.go
make tfgen
make provider
- name: Create Github Release and Tag
if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push'
run: |
# Before we go any further we'll deploy this branch to the mainline, if it works great. If not we'll skip it
git push origin HEAD:main || echo "Skipping merging into main because this branch is not ahead of the mainline branch"
# the schema.json is read by pulumi directly from the repo, so it has to be there, and it can be updated dynamically by everything, so we really don't want it present otherwise
# So we'll generate it during the build and then commit it.
git add provider/cmd/pulumi-resource-authress/schema.json && git commit -m"Committing updated schema.json" || echo "schema.json is up to date."
- name: Create Github Release and Tag
if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push'
run: |
git tag ${VERSION} -f
git push origin ${VERSION}
- name: Import GPG key
if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push'
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
Expand Down

0 comments on commit f7ee2d8

Please sign in to comment.