Skip to content

Post Release

Post Release #48

Workflow file for this run

# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
name: Post Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
prepare:
if: startsWith(github.event.release.tag_name, 'v')
name: Prepare
runs-on: ubuntu-latest
outputs:
modules: ${{ steps.modules.outputs.modules }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Get modules
id: modules
run: |
# shellcheck disable=SC2016
echo "modules=$(find . -name go.mod -type f -print0 | xargs -0 awk '/module/ {print $2}' | jq -c -R '[.,inputs] | map(sub("^github.com\/agntcy\/dir\/";""))')" >> "$GITHUB_OUTPUT"
create-module-tags:
needs: prepare
name: Create module tags
runs-on: ubuntu-latest
strategy:
matrix:
tags: ${{ fromJson(needs.prepare.outputs.modules) }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Create tags
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ matrix.tags }}/${{ github.ref_name }}',
sha: context.sha
})