EIP1-11169 store is from applications api on certificate in database … #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Hotfix: Tag and build" | |
on: | |
push: | |
branches: | |
- hotfix/v* | |
jobs: | |
check-untagged: | |
runs-on: ubuntu-latest | |
outputs: | |
untagged: ${{ !startsWith(env.MATCHING_TAGS, 'v') }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check untagged (don't run for branch creation) | |
id: get-matching-tags | |
shell: bash | |
run: | | |
MATCHING_TAGS=$(git tag --contains HEAD) | |
echo "Matching tags: $MATCHING_TAGS" | |
echo "MATCHING_TAGS=$MATCHING_TAGS" >> $GITHUB_ENV | |
tag: | |
runs-on: ubuntu-latest | |
needs: check-untagged | |
if: needs.check-untagged.outputs.untagged == 'true' | |
outputs: | |
version: ${{ steps.bump-semver.outputs.new_version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get minor version of branch | |
shell: bash | |
run: | | |
echo "${{ needs.check-untagged.outputs.untagged }}" | |
BRANCH_VERSION=${GITHUB_REF#refs/*/hotfix/} | |
BRANCH_VERSION=${BRANCH_VERSION%.*} | |
echo "BRANCH_VERSION=$BRANCH_VERSION" >> $GITHUB_ENV | |
- name: Get latest patch version tag for minor version | |
id: get-latest-tag | |
uses: oprypin/find-latest-tag@v1 | |
with: | |
repository: communitiesuk/eip-ero-print-api | |
releases-only: false | |
prefix: '${{ env.BRANCH_VERSION }}' | |
- name: Bump patch version tag | |
uses: cabinetoffice/action-bump-semver@v1 | |
id: bump-semver | |
with: | |
current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
level: patch | |
- name: Push version tag | |
run: | | |
tag=${{ steps.bump-semver.outputs.new_version }} | |
message='${{ github.event.head_commit.message }}' | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git tag -a "${tag}" -m "${message}" | |
git push origin "${tag}" | |
build-and-push: | |
needs: tag | |
uses: ./.github/workflows/build-and-push.yml | |
with: | |
version: ${{ needs.tag.outputs.version }} | |
secrets: inherit |