-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (54 loc) · 2.03 KB
/
republish_ove_umd_files.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
name: Republish ove umd files
on:
schedule:
- cron: '23 4 * * *'
workflow_dispatch:
jobs:
get_versions:
runs-on: ubuntu-22.04
outputs:
ove_umd_version: ${{ steps.setver.outputs.ove_umd_version }}
ove_version: ${{ steps.setver.outputs.ove_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: set versions
id: setver
run: |
echo "ove_umd_version=$(node -pe "require('./tg-oss-ove-umd/package.json').version")" >> $GITHUB_OUTPUT
echo "ove_version=$(npm view @teselagen/ove version)" >> $GITHUB_OUTPUT
publish:
needs: [get_versions]
if: needs.get_versions.outputs.ove_umd_version < needs.get_versions.outputs.ove_version
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Install latest OVE
run: npm install @teselagen/ove@${{ needs.get_versions.outputs.ove_version }} --silent
- name: Copy umd files
run: bash -c 'cp node_modules/@teselagen/ove/{index.umd.js,style.css} tg-oss-ove-umd/'
- name: Update package version
run: npm version --allow-same-version ${{ needs.get_versions.outputs.ove_version }}
working-directory: ./tg-oss-ove-umd
- name: "Publish @deltablot/tg-oss-ove-umd"
run: npm publish --access public
working-directory: ./tg-oss-ove-umd
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Cleanup
run: |
shopt -s extglob
rm -rf !('package.json'|'README.md')
working-directory: ./tg-oss-ove-umd
- name: Commit new version
run: |
git config --global user.name 'Marcel Bolten'
git config --global user.email 'marcelbolten@users.noreply.github.com'
git commit -am "Automated update, version ${{ needs.get_versions.outputs.ove_version }}"
git push