feat: core - change operation (#1340) #2
Workflow file for this run
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: Create Module Tags | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
validate-and-create-tags: | |
runs-on: ${{ vars.RUNNER_RUNS_ON }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Validate tag format | |
id: validate-tag | |
run: | | |
chmod +x ./scripts/create_module_tags.sh | |
./scripts/create_module_tags.sh "${{ github.ref_name }}" | |
- name: Import GPG key | |
id: import-gpg-key | |
if: steps.validate-tag.outcome == 'success' | |
run: | | |
echo "${{ secrets.MAGALUBOT_GPG_PRIVATE_KEY }}" | gpg --batch --yes --passphrase "${{ secrets.MAGALUBOT_GPG_PASSPHRASE }}" --import | |
- name: Create and push module tags | |
if: steps.import-gpg-key.outcome == 'success' | |
run: | | |
# Configurar usuário do Git | |
git config --global user.name "${{vars.MAGALUBOT_USER_NAME}}" | |
git config --global user.email "${{vars.MAGALUBOT_EMAIL}}" | |
git config --global commit.gpgsign true | |
git config --global tag.gpgsign true | |
git config --global user.signingkey $(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2) | |
TAG_NAME="${{ github.ref_name }}" | |
# Criar as novas tags | |
git tag "mgc/lib/$TAG_NAME" -m "chore: bump version $TAG_NAME" | |
git tag "mgc/sdk/$TAG_NAME" -m "chore: bump version $TAG_NAME" | |
git tag "mgc/core/$TAG_NAME" -m "chore: bump version $TAG_NAME" | |
# Fazer push das novas tags | |
git push origin "mgc/lib/$TAG_NAME" | |
git push origin "mgc/sdk/$TAG_NAME" | |
git push origin "mgc/core/$TAG_NAME" |