updated release

This commit is contained in:
benarc 2024-07-20 18:36:40 +01:00
parent db47653ca6
commit 09bb033f85

View file

@ -1,10 +1,9 @@
on: on:
push: push:
tags: tags:
- "v[0-9]+.[0-9]+.[0-9]+" - 'v[0-9]+.[0-9]+.[0-9]+'
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -15,6 +14,7 @@ jobs:
tag: ${{ github.ref_name }} tag: ${{ github.ref_name }}
run: | run: |
gh release create "$tag" --generate-notes gh release create "$tag" --generate-notes
pullrequest: pullrequest:
needs: [release] needs: [release]
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -29,25 +29,30 @@ jobs:
run: | run: |
git config --global user.name "alan" git config --global user.name "alan"
git config --global user.email "alan@lnbits.com" git config --global user.email "alan@lnbits.com"
- name: Create pull request in extensions repo - name: Create pull request in extensions repo
env: env:
GH_TOKEN: ${{ secrets.EXT_GITHUB }} GH_TOKEN: ${{ secrets.EXT_GITHUB }}
repo_name: "${{ github.event.repository.name }}" repo_name: '${{ github.event.repository.name }}'
tag: "${{ github.ref_name }}" tag: '${{ github.ref_name }}'
branch: "update-${{ github.event.repository.name }}-${{ github.ref_name }}" branch: 'update-${{ github.event.repository.name }}-${{ github.ref_name }}'
title: "[UPDATE] ${{ github.event.repository.name }} to ${{ github.ref_name }}" title: '[UPDATE] ${{ github.event.repository.name }} to ${{ github.ref_name }}'
body: "https://github.com/lnbits/${{ github.event.repository.name }}/releases/${{ github.ref_name }}" body: 'https://github.com/lnbits/${{ github.event.repository.name }}/releases/${{ github.ref_name }}'
archive: "https://github.com/lnbits/${{ github.event.repository.name }}/archive/refs/tags/${{ github.ref_name }}.zip" archive: 'https://github.com/lnbits/${{ github.event.repository.name }}/archive/refs/tags/${{ github.ref_name }}.zip'
run: | run: |
cd lnbits-extensions cd lnbits-extensions
git checkout -b $branch git checkout -b $branch
# if there is another open PR # if there is another open PR
git pull origin $branch || echo "branch does not exist" git pull origin $branch || echo "branch does not exist"
sh util.sh update_extension $repo_name $tag sh util.sh update_extension $repo_name $tag
git add -A git add -A
git commit -am "$title" git commit -am "$title"
git push origin $branch git push origin $branch
# check if pr exists before creating it # check if pr exists before creating it
gh config set pager cat gh config set pager cat
check=$(gh pr list -H $branch | wc -l) check=$(gh pr list -H $branch | wc -l)
test $check -ne 0 || gh pr create --title "$title" --body "$body" --repo lnbits/lnbits-extensions test $check -ne 0 || gh pr create --title "$title" --body "$body" --repo lnbits/lnbits-extensions