forked from aehrc/smart-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (60 loc) · 2.2 KB
/
merge_upstream_branches.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Merge upstream branches
on:
schedule:
# actually, ~5 minutes is the highest
# effective frequency you will get
- cron: '* * * * *'
jobs:
merge:
name: Publish App to Nexus Repository
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Set Git user
run: |
git config --global user.name 'ardihikaru'
git config --global user.email '[email protected]'
- name: Unshallow the repository
run: git pull --unshallow
- name: Add upstream remote
run: git remote add upstream https://github.com/aehrc/smart-forms.git
- name: Fetch upstream changes
run: git fetch upstream
- name: Checkout main branch
run: git checkout main
- name: Replace all files with upstream/main
run: |
git rm -rf .
git checkout upstream/main -- .
git add .
- name: Commit the changes
run: git commit -am "Replace with upstream/main content"
- name: Remove existing workflows
run: git rm -rf .github/workflows
- name: Restore specific files from origin
run: |
git checkout origin/main .github/workflows
- name: Update package.json
run: |
jq '.publishConfig.registry="https://repository.konsulin.care/repository/smart-forms/" | .name="smart-forms" | .version="1.0.9"' package.json > tmp.json
mv tmp.json package.json
- name: Commit the changes
run: git commit -am "update from upstream remote"
continue-on-error: true
- name: Push the changes
run: git push origin main --force
continue-on-error: true
- name: Set Up Node JS
uses: actions/setup-node@v3
with:
node-version: 20.16
check-latest: false
- name: Installing Packages
run: npm install
- name: Set up npm
run: |
echo "registry=https://repository.konsulin.care/repository/smart-forms/" > .npmrc
echo "//repository.konsulin.care/repository/smart-forms/:_authToken=${{ SECRETS.NPM_TOKEN }}" >> .npmrc
- name: Publish npm package
run: npm publish