Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Automatic Releases, Automatic Semver? #472

Open
gschechter opened this issue Jun 17, 2022 · 2 comments
Open

Automatic Releases, Automatic Semver? #472

gschechter opened this issue Jun 17, 2022 · 2 comments

Comments

@gschechter
Copy link

Hi.

I am trying to automatically determine my semver tag on push to main instead of having to supply it. Unfortunately when doing this the change log is only using the latest commit, since I can't specify the previous tag for it to look back at.

Any suggestions?

name: my_workflow
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    needs: [php8_test, php74_tests]
    steps:
      - name: checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
          fetch-depth: 0
      - name: Read Version Number
        id: versioning
        uses: paulhatch/[email protected]
        with:
          tag_prefix: "v"
          major_pattern: "(MAJOR)"
          minor_pattern: "(MINOR)"
          format: "${major}.${minor}.${patch}"
          search_commit_body: false
          user_format_type: "csv"
      - uses: rickstaa/action-create-tag@v1
        with:
          tag: v${{ steps.versioning.outputs.version }}
          message: v${{ steps.versioning.outputs.version }}
      - name: Build
        run: |
          composer install --no-dev --working-dir=my_path/
      - name: Install Zip
        uses: montudor/[email protected]
      - name: Zip output
        run: |
          pushd my_path/
          zip -r my_project.${{ steps.versioning.outputs.version }}.zip my_path/
          popd
      - uses: marvinpinto/action-automatic-releases@latest
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          automatic_release_tag: v${{ steps.versioning.outputs.version }}
          prerelease: false
          title: Release ${{ steps.versioning.outputs.version }}
          files: |
            my_project.${{ steps.versioning.outputs.version }}.zip
          id: automatic_release```
@ldeluigi
Copy link
Contributor

you shouldn't use automatic_release_tag option if you are manually creating it, right?

@AlexAtkinson
Copy link

Try this. Just merge from branches matching the naming scheme.
https://github.com/marketplace/actions/gitops-automatic-versioning

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants