release #29
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: | |
push: | |
paths: | |
- 'mods/**' | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies and build | |
run: | | |
npm install | |
npm run build | |
- 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 version from Lerna | |
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.GITHUB_TOKEN }} | |
exclude_types: other,doc,chore | |
config_file: ./.scripts/tag-changelog-config.js | |
- name: Create draft release | |
if: env.RELEASE != 'none' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.LERNA_VERSION }} | |
release_name: Release v${{ env.LERNA_VERSION }} | |
body: ${{ steps.changelog.outputs.changelog }} | |
draft: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Publish Asterisk to Docker Hub | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: fonoster/asterisk | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
context: . | |
dockerfile: asterisk/Dockerfile | |
tags: "latest, 16" | |
platforms: linux/amd64,linux/arm64 | |
- name: Publish the API Server to Docker Hub | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: fonoster/apiserver | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
context: . | |
dockerfile: mods/apiserver/Dockerfile | |
tags: "latest, ${{ env.LERNA_VERSION }}" | |
platforms: linux/amd64,linux/arm64 | |
- name: Publish the WebUI to Docker Hub | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: fonoster/webui | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
context: . | |
dockerfile: mods/webui/Dockerfile | |
tags: "latest, ${{ env.LERNA_VERSION }}" | |
platforms: linux/amd64,linux/arm64 |