-
Notifications
You must be signed in to change notification settings - Fork 29
33 lines (28 loc) · 1.34 KB
/
deploy_script.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
name: Deploy Userscript
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set URL for master branch
if: github.ref == 'refs/heads/master'
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
sed -i 's|https://github.com/Heistergand/fanfields2/raw/beta/|https://github.com/Heistergand/fanfields2/raw/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
sed -i 's|https://raw.githubusercontent.com/Heistergand/fanfields2/beta/|https://raw.githubusercontent.com/Heistergand/fanfields2/${BRANCH_NAME}/|g' iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
if [[ "$BRANCH_NAME" == "master" ]]; then
sed -i "s|IITC plugin: Fan Fields 2 (beta)|IITC plugin: Fan Fields 2|" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
fi
sed -E -i "s/^\/\/\s*@version\s+(\d+)\.(\d+)\.(\d+)\.(\d+)/\1.\2.\3/" iitc_plugin_fanfields2.user.js iitc_plugin_fanfields2.meta.js
- name: Commit and push changes
run: |
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add .
git commit -m "Update files from GitHub Action"
git push