diff --git a/.github/workflows/_create_github_release.yml b/.github/workflows/_create_github_release.yml new file mode 100644 index 0000000..3d6b271 --- /dev/null +++ b/.github/workflows/_create_github_release.yml @@ -0,0 +1,29 @@ +on: + workflow_call: + inputs: + version: + description: 'Version to release' + required: true + type: string + workflow_dispatch: + inputs: + version: + description: 'Version to release' + required: true + type: string + +jobs: + # create github release + create_release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/create-release@v1 + with: + tag_name: v${{ inputs.version }} + release_name: Release v${{ inputs.version }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/bump-my-version.yml b/.github/workflows/bump-my-version.yml index 6789244..6aaa234 100644 --- a/.github/workflows/bump-my-version.yml +++ b/.github/workflows/bump-my-version.yml @@ -17,6 +17,9 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: # notify if someone is trying to run this from any other branch than `release` - name: Ensure on release branch diff --git a/.github/workflows/push_to_release.yml b/.github/workflows/push_to_release.yml index 9849e07..da1b535 100644 --- a/.github/workflows/push_to_release.yml +++ b/.github/workflows/push_to_release.yml @@ -40,10 +40,16 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Create tag run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git tag v${{ steps.get_version.outputs.version }} - git push origin v${{ steps.get_version.outputs.version }} + TAG="v${{ steps.get_version.outputs.version }}" + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag $TAG already exists. Skipping tag creation." + exit 0 + else + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag "$TAG" + git push origin "$TAG" + fi outputs: version: ${{ steps.get_version.outputs.version }} @@ -76,14 +82,9 @@ jobs: # with: # repository-url: https://test.pypi.org/legacy/ - # create github release create_release: + name: Create GitHub Release needs: [create_tag, publish_package] - runs-on: ubuntu-latest - steps: - - uses: actions/create-release@v1 - with: - tag_name: v${{ needs.create_tag.outputs.version }} - release_name: Release v${{ needs.create_tag.outputs.version }} - draft: false - prerelease: false + uses: ./.github/workflows/_create_github_release.yml + with: + version: ${{ needs.create_tag.outputs.version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f6f8d35..637cb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the [mlfmu] project will be documented in this file.
The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## [1.0.3] ### Changed diff --git a/README.md b/README.md index 499efe1..ef01e29 100644 --- a/README.md +++ b/README.md @@ -320,7 +320,16 @@ Hee Jong Park - [@LinkedIn](https://www.linkedin.com/in/heejongpark/) -