-
-
Notifications
You must be signed in to change notification settings - Fork 73
51 lines (49 loc) · 1.36 KB
/
new-version-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: New Version Workflow
on:
push:
tags:
- v*
jobs:
test:
container:
image: node:16.13-alpine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm test
new-version:
needs: test
if: ${{ !contains(github.event.head_commit.message, 'NO_DEPLOY') }}
container:
image: alpine:3.11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# 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
pwd
ls
ls trunk
# minify js
cd trunk/scripts
rm -f *.min.js
for file in *.js; do
minify $file > $(basename $file .js).min.js;
done
TAG="${{ github.ref_name }}"
sed -i "s/{{VERSION}}/${TAG}/g" construct-leaflet-map.min.js;
- run: |
cd /repo
# add all svn
svn add --force .
# new tag
TAG="${{ github.event.ref }}"
svn cp trunk tags/${TAG//refs\/tags\/v}
svn ci -m "${{ github.event.head_commit.message }}" --username ${{ secrets.SVN_USER }} --password ${{ secrets.SVN_PASSWORD }}