Skip to content

Post release

Post release #11

Workflow file for this run

name: Post release
on:
release:
types: [published]
permissions: write-all
env:
WARDUINO: 'warduino'
VERSIONNAME: ${{ github.ref_name }}
jobs:
bump-in-warduino:
runs-on: ubuntu-latest
steps:
# clone latch
- uses: actions/checkout@v4
# clone warduino
- uses: actions/checkout@v4
with:
repository: 'TOPLLab/WARDuino'
path: 'warduino'
ssh-key: ${{ secrets.WARDUINO_DEPLOY }}
# update package
- name: Bump latch version for WARDuino
run: |
rm ${GITHUB_WORKSPACE}/${WARDUINO}/tests/latch/*.tgz
npm i
npm run build
npm pack --pack-destination ${GITHUB_WORKSPACE}/${WARDUINO}/tests/latch/
# update package.json
- name: Update package.json in WARDuino
run: |
cd tests/latch
VERSION=${VERSIONNAME#v}
sed -i "s|\"latch\": \"file:./latch-[^\"]*\"|\"latch\": \"file:./latch-$VERSION.tgz\"|" package.json
working-directory: 'warduino'
env:
VERSION: $(echo "${{ github.ref }}" | sed -e 's:v\(.*\):\1:')
# commit
- name: Push changes
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add tests/latch/
VERSION=${VERSIONNAME#v}
git checkout -b bump/latch-$VERSION
git commit -m "⬆️ Bump latch version"
git push --set-upstream origin bump/latch-$VERSION
working-directory: 'warduino'
env:
VERSION: $(echo "${{ github.ref }}" | sed -e 's:v\(.*\):\1:')
# create pull request
- name: Create Pull Request
run: |
VERSION=${VERSIONNAME#v}
gh pr create --title "⬆️ Bump latch to $VERSIONNAME" --body "Bumping latch to \`$VERSIONNAME\`" --base main --head bump/latch-$VERSION --label dependencies
working-directory: 'warduino'
env:
VERSION: $(echo "${{ github.ref }}" | sed -e 's:v\(.*\):\1:')
GH_TOKEN: ${{ secrets.WARDUINO_LATCH }}