release #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
skip_tests: | |
description: 'Skip compliance tests' | |
required: false | |
type: choice | |
options: | |
- 'false' | |
- 'true' | |
jobs: | |
build-and-test: | |
name: Build and run SIP Connect Compliance Tests | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT }} | |
- name: Installing Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Build project | |
run: npm run make | |
- name: Check for next release | |
run: | | |
release=$(.scripts/next-release.sh) | |
echo "Next release: $release" | |
echo "RELEASE=$release" >> $GITHUB_ENV | |
- name: Publish packages to NPM | |
if: env.RELEASE != 'none' | |
run: | | |
echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{ secrets.GH_PAT }}" >> $GITHUB_ENV | |
echo "@routr:registry=https://registry.npmjs.org/" > .npmrc | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | |
git config --global user.name "GitHub Actions Bot" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git checkout package-lock.json | |
npm run publish | |
- name: Get Lerna version | |
run: | | |
lerna_version=$(node -p "require('./lerna.json').version") | |
echo "LERNA_VERSION=$lerna_version" >> $GITHUB_ENV | |
- name: Create release note | |
if: env.RELEASE != 'none' | |
id: changelog | |
uses: loopwerk/tag-changelog@v1 | |
with: | |
token: ${{ secrets.DEPLOY_KEY }} | |
exclude_types: other,doc,chore | |
config_file: ./.scripts/tag-changelog-config.js | |
- name: Create draft release | |
if: env.RELEASE != 'none' | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.DEPLOY_KEY }} | |
with: | |
tag_name: v${{ env.LERNA_VERSION }} | |
release_name: Release v${{ env.LERNA_VERSION }} | |
body: ${{ steps.changelog.outputs.changelog }} | |
draft: true | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: routr-build | |
path: | | |
mods | |
.scripts | |
config | |
lerna.json | |
Dockerfile | |
etc/edgeport.yaml | |
!mods/**/node_modules | |
!mods/**/src | |
!mods/**/test | |
!mods/**/dist/*.ts | |
# This step is only executed for workflow_dispatch events with skip_tests = false | |
- name: SIP Connect v1.1 Compliance Tests | |
if: github.event.inputs.skip_tests == 'false' | |
run: | | |
docker-compose -f compose.yaml -f compose.dev.yaml up --build --abort-on-container-exit --exit-code-from compliance | |
publish-to-docker-hub: | |
name: Publish to Docker Hub | |
uses: ./.github/workflows/docker-hub-release.yaml | |
secrets: inherit | |
needs: [build-and-test] |