Update Workflow #20
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: Update Workflow | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
# only triggers on solo readme commits basically | |
paths: | |
- '*.txt' | |
- '!languages/**' | |
- '!scripts/**' | |
- '!shortcodes/**' | |
- '!templates/**' | |
- '!tests/**' | |
- '!*.php' | |
- '!docker*' | |
- '!*.css' | |
jobs: | |
update: | |
container: | |
image: alpine:3.20 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# setup | |
- run: apk add --no-cache subversion nodejs npm | |
- run: npm i -g [email protected] | |
- run: svn co -q https://plugins.svn.wordpress.org/leaflet-map /repo | |
- run: rm -rf /repo/trunk/* | |
- run: cp -r * /repo/trunk | |
- run: | | |
cd /repo | |
# get version | |
VERSION=$(node -p "require('./trunk/package.json').version") | |
# update tagged | |
svn rm tags/${VERSION} | |
svn cp trunk tags/${VERSION} | |
# add all svn | |
svn add --force . | |
svn ci -m "${{ github.event.head_commit.message }}" --username ${{ secrets.SVN_USER }} --password ${{ secrets.SVN_PASSWORD }} |