Skip to content

Republish ove umd files #419

Republish ove umd files

Republish ove umd files #419

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