Skip to content

Commit

Permalink
ci: use release tags
Browse files Browse the repository at this point in the history
Signed-off-by: drptbl <[email protected]>
  • Loading branch information
drptbl committed Nov 16, 2024
1 parent d18659a commit 1f72712
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/sync-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ jobs:
- name: Sync with upstream
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
RELEASE_TAG: ${{ github.event.client_payload.release }}
run: |
git checkout develop
git merge upstream/develop
git push origin develop
git fetch upstream --tags # Fetch all tags
# If triggered by monitor, checkout the specific release tag
if [ -n "$RELEASE_TAG" ]; then
git checkout $RELEASE_TAG
else
git merge upstream/develop
fi
git push origin develop
- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -69,16 +77,22 @@ jobs:
- name: Create Release
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
RELEASE_TAG: ${{ github.event.client_payload.release }}
run: |
VERSION=$(node -p "require('./package.json').version")
# Use the tag version if provided, otherwise use package.json
if [ -n "$RELEASE_TAG" ]; then
VERSION=${RELEASE_TAG#v} # Remove 'v' prefix if present
else
VERSION=$(node -p "require('./package.json').version")
fi
# Check if release already exists
if gh release view "v${VERSION}-no-lavamoat" --repo ${{ github.repository }} &>/dev/null; then
echo "Release v${VERSION}-no-lavamoat already exists. Skipping release creation."
exit 0
fi
# Create the release if it doesn't exist
# Create the release
gh release create "v${VERSION}-no-lavamoat" \
--repo ${{ github.repository }} \
--title "v${VERSION} (No LavaMoat)" \
Expand Down

0 comments on commit 1f72712

Please sign in to comment.