Added ff master and prevented other branches getting a release

This commit is contained in:
2024-12-27 00:02:31 +01:00
parent ffcc57549f
commit a54ab12f11

View File

@@ -18,7 +18,14 @@ inputs:
runs: runs:
using: composite using: composite
steps: steps:
- uses: actions/checkout@v4 - name: Checkout repo
uses: actions/checkout@v4
- name: Checking if ran on the dev branch
run: |
if [[ "${{ github.ref }}" != refs/tags/dev ]]; then
log_info $(red)ERROR$(reset_color) This can only be ran on the dev branch
exit 1
fi
- name: Get new version - name: Get new version
run: | run: |
last_version="$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3 || echo "")" last_version="$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3 || echo "")"
@@ -63,3 +70,9 @@ runs:
git fetch git fetch
git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}" git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}"
git push origin "v${NEW_VERSION}" git push origin "v${NEW_VERSION}"
- name: Fast forwarding master branch to dev
run: |
log_info "Fast-forwarding master to dev"
git checkout master
git merge --ff-only origin/dev
git push --force-with-lease