Merge pull request #8 from mobilecoinofficial/revert-7-fix-cache-dirs #18
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
# Copyright (c) 2022 MobileCoin Inc. | |
name: tag | |
on: | |
push: | |
branches: | |
- main | |
# Refresh images on the first of every month for OS security updates. | |
# schedule: | |
# - cron: '0 0 1 * *' | |
jobs: | |
tag: | |
runs-on: [self-hosted, Linux, small] | |
steps: | |
# We need to use an external PAT here because GHA will not run downstream events if we use the built in token. | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.ACTIONS_TOKEN }} | |
- name: Bump GitHub tag | |
id: bump | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | |
WITH_V: 'true' | |
DEFAULT_BUMP: patch | |
DRY_RUN: 'true' | |
# Doing manual tags because anothrNick/github-tag-action won't retag a commit. | |
- name: Get major and minor values for new tag | |
id: tags | |
env: | |
TAG: ${{ steps.bump.outputs.new_tag }} | |
run: | | |
export MAJOR_MINOR=${TAG%.*} | |
export MAJOR=${MAJOR_MINOR%.*} | |
git tag --force "${MAJOR}" | |
git tag --force "${MAJOR_MINOR}" | |
git tag --force "${TAG}" | |
git push --tags --force |