You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
name: Publish dev
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 */4 * *'
|
|
|
|
jobs:
|
|
npm:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: 'develop'
|
|
|
|
- name: Install Node v16
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16
|
|
registry-url: https://registry.npmjs.org/
|
|
cache: npm
|
|
|
|
- name: Check previous released version
|
|
id: pre-release
|
|
run: |
|
|
if [[ $(npm view trackmania.io@dev version | grep -e "$(jq --raw-output '.version' package.json)-dev.*.$(git rev-parse --short HEAD | cut -b1-3)") ]]; \
|
|
then echo '::set-output name=release::false'; \
|
|
else echo '::set-output name=release::true'; fi
|
|
|
|
- name: Install dependencies
|
|
if: steps.pre-release.outputs.release == 'true'
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Deprecate old dev version
|
|
if: steps.pre-release.outputs.release == 'true'
|
|
run: "npm deprecate trackmania.io@$(npm view trackmania.io@dev version) 'no longer supported' || true"
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
|
|
|
|
- name: Publish
|
|
if: steps.pre-release.outputs.release == 'true'
|
|
run: |
|
|
npm version --git-tag-version=false $(jq --raw-output '.version' package.json)-dev.$(date +%d%m%y).$(git rev-parse --short HEAD)
|
|
npm publish --tag dev || true
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
|