Skip to content

chore(docs): policy docs (VIV-1558) (#1635) #559

chore(docs): policy docs (VIV-1558) (#1635)

chore(docs): policy docs (VIV-1558) (#1635) #559

on:
push:
branches:
- main
name: release-please
jobs:
tag-vivid-vue:
# As we've instructed release-please not to create a vivid-vue release for now, we need to create the tag ourselves
# This job will check if a tag for the current version of vivid-vue exists, and if not, create it
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check tag
id: check_tag
run: |
TAG_NAME=vivid-vue-v$(node -p "require('./libs/vue-wrappers/package.json').version")
echo "Vivid-vue tag name: ${TAG_NAME}"
if git show-ref --tags --verify --quiet "refs/tags/${TAG_NAME}"; then
echo "Tag ${TAG_NAME} exists"
else
echo "Tag ${TAG_NAME} does not exist"
echo "::set-output name=missing_tag_name::${TAG_NAME}"
fi
- name: Create Tag
if: steps.check_tag.outputs.missing_tag_name
uses: actions/github-script@v6
env:
TAG_NAME: ${{ steps.check_tag.outputs.missing_tag_name }}
with:
script: |
const { TAG_NAME } = process.env
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${TAG_NAME}`,
sha: context.sha
})
release-please:
runs-on: ubuntu-latest
needs: tag-vivid-vue
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
build:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: build
run: |
npm ci --ignore-scripts
npx nx run components:build
npx nx run components:generateMeta
npx nx run vue-wrappers:build
- name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: dist/
npm-publish:
runs-on: ubuntu-latest
needs: build
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: dist/
- name: publish vivid npm package
run: npm publish dist/libs/components --//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_VVD_VNG_AUTOMATION_TOKEN }}
- name: publish vivid-vue npm package
run: npm publish dist/libs/vue-wrappers --//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_VVD_VNG_AUTOMATION_TOKEN }}
github-publish:
runs-on: ubuntu-latest
needs: build
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: dist/
- name: publish vivid to github packages
run: npm publish ./dist/libs/components --registry=https://npm.pkg.github.com --//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.VNG_VVD_PAT }}
- name: publish vivid-vue to github packages
run: npm publish ./dist/libs/vue-wrappers --registry=https://npm.pkg.github.com --//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.VNG_VVD_PAT }}
deploy-deno:
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
uses: ./.github/workflows/_deploy-deno.yml