update-tag #14
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: Remote Tagging | |
on: | |
repository_dispatch: | |
types: [update-tag] | |
permissions: | |
contents: write | |
repository-projects: write | |
jobs: | |
submodule: | |
name: Update submodule and create tag | |
runs-on: Ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Update submodule | |
run: | | |
git submodule init | |
git submodule update --recursive --remote | |
cd examples/open-simulation-interface | |
git checkout ${{ github.event.client_payload.tag }} | |
cd ../.. | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -m "git submodule updated" | |
continue-on-error: true | |
- name: Create Antora tag | |
run: git tag x-antora-${{ github.event.client_payload.tag }} | |
- name: Create release tag | |
run: | | |
REPO_TAG="v$(sed -rn 's/VERSION_MAJOR = (.+)/\1/p' VERSION).$(sed -rn 's/VERSION_MINOR = (.+)/\1/p' VERSION).$(sed -rn 's/VERSION_PATCH = (.+)/\1/p' VERSION)${{ github.event.client_payload.suffix }}" | |
git tag ${REPO_TAG} | |
- name: GitHub Push | |
uses: CasperWA/[email protected] | |
with: | |
# Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }} | |
token: ${{ secrets.MACHINE_USER_PAT }} | |
branch: master | |
# Determines if --tags is used | |
tags: true | |
force: true | |
unprotect_reviews: true | |
- name: Trigger examples creation | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.MACHINE_USER_PAT }} | |
event-type: examples-build | |
client-payload: '{"tag": "${{ github.event.client_payload.tag }}", "source_repo": "${{ github.event.client_payload.source_repo }}"}' | |