Skip to content

bump-relay-stable

bump-relay-stable #18

Workflow file for this run

name: Bump stable tag
on:
repository_dispatch:
types:
- bump-relay-stable
permissions:
contents: write
pull-requests: write
jobs:
bump-relay-stable:
name: Bump stable tag
runs-on: ubuntu-latest
if: github.event.action == 'bump-relay-stable'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Update config
env:
TAG_NAME: ${{ github.event.client_payload.tag }}
run: |
echo "Updating stable tag to $TAG_NAME"
VERSION="${TAG_NAME#v}"
sed -i -E "s/RELAY_SET_DOWNLOAD_URL\(\[[0-9.]+\]\)/RELAY_SET_DOWNLOAD_URL([$VERSION])/" config.m4
- name: Commit changes
env:
TAG_NAME: ${{ github.event.client_payload.tag }}
run: |
BRANCH=pr/stable-$TAG_NAME
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
echo "Pushing changes to $BRANCH branch"
git checkout -b $BRANCH
git add config.m4
git commit -m "Bump stable to $TAG_NAME"
git push -u origin $BRANCH
- name: Create draft release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.client_payload.tag }}
run: |
RELEASE_URL=$(gh release create "$TAG_NAME" \
--repo cachewerk/ext-relay \
--title "$TAG_NAME" \
--target main \
--draft \
--notes "https://github.com/cachewerk/relay/releases/tag/$TAG_NAME")
echo "url=$RELEASE_URL" >> $GITHUB_OUTPUT
- name: Open pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.client_payload.tag }}
RELEASE_URL: ${{ steps.create_release.outputs.url }}
run: |
BODY=$(printf '⚠️ Merge this PR, then publish the draft release:\n\n%s' "$RELEASE_URL")
gh pr create \
--repo cachewerk/ext-relay \
--base main \
--head "pr/stable-$TAG_NAME" \
--title "Relay $TAG_NAME" \
--body "$BODY"