Skip to content

Commit

Permalink
Revert "ci(release): allow releasing a tag on an older commit; improv…
Browse files Browse the repository at this point in the history
…e branch checking"

This reverts commit ca156ea.
  • Loading branch information
chanshing committed Jul 24, 2024
1 parent f1c1a31 commit 6fac52a
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:

jobs:
build-n-publish:
if: github.event.base_ref == 'refs/heads/main' || github.event.base_ref == 'refs/heads/master'
name: Publish to PyPI
runs-on: ubuntu-latest

Expand All @@ -23,21 +24,6 @@ jobs:
# A shallow clone can work when the following issue is resolved:
# https://github.com/actions/checkout/issues/338
fetch-depth: 0

- name: Check branch for tag
run: |
BRANCH_NAME=$(git branch --contains ${{ github.ref }} | grep -E 'main|master' | xargs)
if [[ -z "$BRANCH_NAME" ]]; then
echo "##[error]Tag is not in main or master branch."
exit 1
fi
- name: Fetch the latest tag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag is $LATEST_TAG"
git checkout $LATEST_TAG

- name: Setup Java
uses: actions/setup-java@v4
Expand Down

0 comments on commit 6fac52a

Please sign in to comment.