-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.11 KB
/
tag.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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: ubuntu-22.04
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