Skip to content

Commit

Permalink
Merge pull request #5 from mobilecoinofficial/capture-tag-from-commit
Browse files Browse the repository at this point in the history
Add inital commit and test tag from commit message [tag/2.311.0]
  • Loading branch information
jgreat authored Jan 5, 2024
2 parents f8266ef + 3062901 commit 8222dce
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
6 changes: 1 addition & 5 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
self-hosted-runner:
# Labels of self-hosted runner in array of string
labels:
- small
- large

2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 MobileCoin Inc.
# Copyright (c) 2024 MobileCoin Inc.
name: build-and-publish

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 MobileCoin Inc.
# Copyright (c) 2024 MobileCoin Inc.
name: checks

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023 MobileCoin Inc.
# Copyright (c) 2024 MobileCoin Inc.
name: release

on:
Expand Down
45 changes: 16 additions & 29 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright (c) 2023 MobileCoin Inc.
# Copyright (c) 2024 MobileCoin Inc.
name: tag

on:
push:
branches:
- main

# when the gh publishes a new ghcr.io/actions/actions-runner image renovate should PR.
# we want the tag from renovate update?
# can we get renovate to add something like `[tag/2.310.0]` to the commit message?
# something we can scrape?
# when the gh publishes a new ghcr.io/actions/actions-runner image renovate should PR and add in a message like `[tag/2.310.0]`
# capture this output and tag the repo triggering the other build actions.

jobs:
tag:
Expand All @@ -21,32 +19,21 @@ jobs:
with:
token: ${{ secrets.ACTIONS_TOKEN }}

- name: Get new tag from commit
- name: Get new tag from commit and push
shell: bash
env:
MESSAGE: ${{ github.event.head_commit.message }}
run: |
echo "${MESSAGE}"
regex=".*\[tag/(.*)\].*"
# - 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
if [[ "${MESSAGE}" =~ $regex ]]
then
tag=${BASH_REMATCH[1]}
echo -n "Found tag: ${tag}"
git tag --force "${tag}"
git push --tags --force
else
echo "Could not find tag in commit message"
echo "${MESSAGE}"
exit 0
fi

0 comments on commit 8222dce

Please sign in to comment.