Skip to content

Commit

Permalink
Merge pull request #53 from SmartCodeMaker/main
Browse files Browse the repository at this point in the history
Allow making GitHub Release Pages from `main` branch commits with tags
  • Loading branch information
wassimj authored May 4, 2024
2 parents 8e39ad9 + 0022521 commit d4a43d5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
#
# Anything pushed into the branch `releases/*` with a tag will be published
# Anything pushed into the branch `main` with a tag will be published
# on GitHub Release Page as draft upon succesful build and test on three
# operating systems and Python >= 3.8.
#
# Recommended branch names for releases: `releases/5.x`, `releases/6.x`.
# Git tag specifies exact version. Example of git tags: `v5.0.0`,
# `v6.0.0`, `v6.5.1`.
#
# Anything pushed into a different branch will be built and tested without
# making any release on GitHub Release Page.
#
# Pull Requests will be built and tested without making any release on GitHub
# Release Page. Merge the branch 'releases/*' with the Pull Request and get
# a new GitHub Release (draft), if git tag is set.
# Release Page. Merge the branch 'main' with the Pull Request and get
# a new GitHub Release (draft) ONLY if a git tag is set.
#
# Normally, validated Pull Requests are going into `main` branch.
# Once it is considered that the release can be made, just place
# any commits from `main` into `releases/*` (e.g. `releases/6.x`) and
# set appropriate tag, e.g. `v6.0.7`, then push the releases branch to GitHub.
# This way GitHub Release Page creation can be automated.
#
# If you pushed the release branch to GitHub and forgot to set tag name,
# If you updated the main branch on GitHub and forgot to set a tag name,
# the release won't published (as draft) on GitHub Release Page. No worries,
# add the tag later and restart the workflow in GitHub Actions for the
# commit which already was in the workflow.
Expand Down Expand Up @@ -592,7 +585,7 @@ jobs:
- build-macos-py38
name: Make Release
runs-on: ubuntu-22.04
if: ${{ startsWith(needs.prepare-build-info.outputs.tagname, 'v') && startsWith(needs.prepare-build-info.outputs.branchname, 'releases/') }}
if: ${{ startsWith(needs.prepare-build-info.outputs.tagname, 'v') && needs.prepare-build-info.outputs.branchname == 'main' }}
permissions:
# IMPORTANT: mandatory for GitHub Releases
contents: write
Expand Down

0 comments on commit d4a43d5

Please sign in to comment.