Skip to content

shared utilities

shared utilities #5

Workflow file for this run

name: On push main
on:
push:
branches:
- main
jobs:
get-module-to-publish:
uses: ./.github/workflows/get-changed-module.yml
create-tag:
runs-on: ubuntu-latest
needs: get-module-to-publish
if: ${{ needs.get-module-to-publish.outputs.module_dir }}
outputs:
tag: ${{ steps.create-tag.outputs.result }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install semver
run: npm install semver
- name: Get base and head versions
id: get-versions
env:
PublicRelease: true
run: |
echo ::set-output name=base_version::$(nbgv get-version ${{ github.event.before }} --format json | jq '.SemVer2')
echo ::set-output name=head_version::$(nbgv get-version ${{ github.event.after }} --format json | jq '.SemVer2')
working-directory: ${{ needs.get-module-to-publish.outputs.module_dir }}
- name: Create tag
id: create-tag
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const script = require("./scripts/github-actions/create-tag.js")
return await script({
require,
github,
context,
core,
moduleDir: "${{ needs.get-module-to-publish.outputs.module_dir }}",
baseVersion: ${{ steps.get-versions.outputs.base_version }},
headVersion: ${{ steps.get-versions.outputs.head_version }},
})
publish-module:
needs: create-tag
if: needs.create-tag.outputs.tag
uses: ./.github/workflows/publish-module.yml
with:
tag: ${{ needs.create-tag.outputs.tag }}
secrets:
PUBLISH_CLIENT_ID: ${{ secrets.PUBLISH_CLIENT_ID }}
PUBLISH_TENANT_ID: ${{ secrets.PUBLISH_TENANT_ID }}
PUBLISH_SUBSCRIPTION_ID: ${{ secrets.PUBLISH_SUBSCRIPTION_ID }}
PUBLISH_REGISTRY_SERVER: ${{ secrets.PUBLISH_REGISTRY_SERVER }}