Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: do not upload artifacts for pre-releases #2143

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
run: | # Note: MSI_VERSION requires . as a separator, so replace "-" in the tag with ".".
run: | # Note: MSI_VERSION requires . as a separator and admits only numbers, so replace "-[a-z]*" in the tag with ".".
VERSION=${GITHUB_REF#refs/tags/v}
MSI_VERSION=${VERSION//-/.}
MSI_VERSION=${VERSION//-[a-z]*./.}
make dist VERSION=$VERSION MSI_VERSION=$MSI_VERSION
echo "VERSION=${VERSION}" >> $GITHUB_ENV
shell: bash
Expand Down Expand Up @@ -181,6 +181,12 @@ jobs:
ls dist
tag="${GITHUB_REF#refs/tags/}"
./.github/workflows/release_notes.sh ${tag} > release-notes.txt
gh release create ${tag} --draft --notes-file release-notes.txt --title ${GITHUB_REF#refs/tags/} ./dist/*
if [[ $VERSION =~ -[a-z]+\. ]]; then
# If it is a pre-release (e.g. it contains `-pre.`) create release notes without artifacts.
gh release create ${tag} --draft --notes-file release-notes.txt --title ${GITHUB_REF#refs/tags/}
else
# Otherwise upload artifacts.
gh release create ${tag} --draft --notes-file release-notes.txt --title ${GITHUB_REF#refs/tags/} ./dist/*
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading