Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CY-6250] Version not updating #58

Open
daniel-van-niekerk opened this issue Jun 20, 2022 · 2 comments
Open

[CY-6250] Version not updating #58

daniel-van-niekerk opened this issue Jun 20, 2022 · 2 comments
Labels
jira-issue Issue tracked on JIRA

Comments

@daniel-van-niekerk
Copy link

Version stays on 0.0.1. What am I missing?

@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Jun 20, 2022
@github-actions github-actions bot changed the title Version not updating [CY-6250] Version not updating Jun 20, 2022
@github-actions
Copy link

Internal ticket created : CY-6250

@james-arawhanui
Copy link

james-arawhanui commented Oct 6, 2022

I believe the docs need to emphasize adding the tag back on the commit during the same workflow that the version is bumped.

Hopefully this helps, here are the relevant sections I found myself stuck on for a few hours today:

on:
  push:
    branches: ["main"]
    paths:
      # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#patterns-to-match-file-paths
      #
      # anything within the solution directory (recursive)
      - repo-root/path/to/module/**
      #
      # trigger when this workflow gets updated also.
      - .github/workflows/module.yml

# ...

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    permissions:
      # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
      contents: write
      packages: write

# ...

      - name: Git Version
        id: gitversion
        uses: codacy/[email protected]
        with:
          log-paths: repo-root/path/to/module
          release-branch: main

# ...

      - name: Extract metadata (tags, labels) for Docker
        # https://github.com/docker/metadata-action
        id: meta
        uses: docker/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
          #
          # https://stackoverflow.com/questions/59191913/how-do-i-get-the-output-of-a-specific-step-in-github-actions
          tags: |
            type=semver,pattern={{version}},value=${{steps.gitversion.outputs.version}}

      - name: Build and push Docker image
        # https://github.com/docker/build-push-action
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: ./repo-root/path/to/module
          file: ./repo-root/path/to/module/Dockerfile
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

      - name: Tag Release
        # https://github.com/marketplace/actions/create-update-tag
        uses: rickstaa/action-create-tag@v1
        with:
          tag: ${{ steps.gitversion.outputs.version }}
          message: "Releasing version ${{ steps.gitversion.outputs.version }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

2 participants