Skip to content

Merge branch 'develop' #1

Merge branch 'develop'

Merge branch 'develop' #1

Workflow file for this run

name: Release
on:
push:
branches: [main]
jobs:
release:
name: Bump version and release
runs-on: self-hosted
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # necesario para leer tags y changelog
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests before release
run: wolframscript -file tests/RunAllTests.wl
- name: Read current version
id: version
run: |
VERSION=$(cat QMB/version.txt | tr -d '[:space:]')
echo "current=$VERSION" >> $GITHUB_OUTPUT
- name: Bump patch version
id: bump
run: |
VERSION=${{ steps.version.outputs.current }}
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
echo "$NEW_VERSION" > QMB/version.txt
echo "new=$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Update PacletInfo.wl
run: |
sed -i 's/Version -> "[^"]*"/Version -> "${{ steps.bump.outputs.new }}"/' QMB/PacletInfo.wl
- name: Commit version bump
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add QMB/version.txt QMB/PacletInfo.wl
git commit -m "chore: bump version to ${{ steps.bump.outputs.new }}"
git push
- name: Create tag
run: |
git tag v${{ steps.bump.outputs.new }}
git push origin v${{ steps.bump.outputs.new }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.bump.outputs.new }}
generate_release_notes: true