Release #104
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: | |
release-tag: | |
description: 'Release Tag' | |
required: true | |
default: 'release/XXX' | |
miranum-cli: | |
description: 'Release miranum-cli app?' | |
type: boolean | |
required: true | |
default: true | |
miranum-core: | |
description: 'Release miranum-core?' | |
type: boolean | |
required: true | |
default: true | |
miranum-create-append-c7-element-templates: | |
description: 'Release miranum-create-append-c7-element-templates' | |
type: boolean | |
required: true | |
default: true | |
miranum-vscode-plugins: | |
description: 'Release all vscode plugins?' | |
type: boolean | |
required: true | |
default: true | |
spring-boot-apps: | |
description: 'Release spring boot services?' | |
type: boolean | |
required: true | |
default: false | |
spring-boot-apps-snapshot: | |
description: 'Snapshot release for spring boot services?' | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Install dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
# miranum-cli | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-cli | |
path: dist/apps/miranum-cli | |
# miranum-core | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-core | |
path: dist/libs/miranum-core | |
# miranum-create-append-c7-element-templates | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-create-append-c7-element-templates | |
path: dist/libs/miranum-create-append-c7-element-templates | |
# miranum-extension-pack | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-extension-pack | |
path: dist/apps/miranum-extension-pack | |
# miranum-config-editor | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-config-editor | |
path: dist/apps/miranum-config-editor | |
# miranum-console | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-console | |
path: dist/apps/miranum-console | |
# miranum-forms | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-forms | |
path: dist/apps/miranum-forms | |
# miranum-modeler | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: miranum-modeler | |
path: dist/apps/miranum-modeler | |
# spring boot apps | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: spring-boot-apps | |
path: spring-boot-apps | |
create-release: | |
if: github.event.inputs.release-tag | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create tag | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ github.event.inputs.release-tag }}', | |
sha: context.sha | |
}) | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.release-tag }} | |
release_name: Release ${{ github.event.inputs.release-tag }} | |
draft: false | |
prerelease: false | |
# miranum-cli | |
publish-miranum-cli: | |
if: github.event.inputs.miranum-cli == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-cli | |
- name: Publish | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_SECRET }} | |
# miranum-core | |
publish-miranum-core: | |
if: github.event.inputs.miranum-core == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-core | |
- name: Publish | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_SECRET }} | |
# miranum-create-append-c7-element-templates | |
publish-miranum-create-append-c7-element-templates: | |
if: github.event.inputs.miranum-create-append-c7-element-templates == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-create-append-c7-element-templates | |
- name: Publish | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_SECRET }} | |
# miranum-extension-pack | |
publish-miranum-extension-pack: | |
if: github.event.inputs.miranum-vscode-plugins == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-extension-pack | |
- name: Prepare | |
run: npm install && npm install -g @vscode/vsce@latest | |
- name: Publish extension | |
run: vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PUBLISH }} | |
# miranum-config-editor | |
publish-miranum-config-editor: | |
if: github.event.inputs.miranum-vscode-plugins == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-config-editor | |
- name: Prepare | |
run: npm install && npm install -g @vscode/vsce@latest | |
- name: Build vsix | |
run: vsce package --out miranum-config-editor.vsix | |
- name: Publish extension | |
run: vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PUBLISH }} | |
# miranum-console | |
publish-miranum-console: | |
if: github.event.inputs.miranum-vscode-plugins == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-console | |
- name: Prepare | |
run: npm install && npm install -g @vscode/vsce@latest | |
- name: Build vsix | |
run: vsce package --out miranum-console.vsix | |
- name: Publish extension | |
run: vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PUBLISH }} | |
# miranum-forms | |
publish-miranum-forms: | |
if: github.event.inputs.miranum-vscode-plugins == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-forms | |
- name: Prepare | |
run: npm install && npm install -g @vscode/vsce@latest | |
- name: Build vsix | |
run: vsce package --out miranum-forms.vsix | |
- name: Publish extension | |
run: vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PUBLISH }} | |
# miranum-modeler | |
publish-miranum-modeler: | |
if: github.event.inputs.miranum-vscode-plugins == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- name: Setup NodeJS 16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v3 | |
with: | |
name: miranum-modeler | |
- name: Prepare | |
run: npm install && npm install -g @vscode/vsce@latest | |
- name: Build vsix | |
run: vsce package --out miranum-modeler.vsix | |
- name: Publish extension | |
run: vsce publish | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PUBLISH }} | |
publish-spring-boot-apps: | |
if: github.event.inputs.spring-boot-apps == 'true' | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- create-release | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: spring-boot-apps | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Remove Snapshot | |
if: github.event.inputs.spring-boot-apps-snapshot == 'false' | |
run: | | |
cd miranum-deployment && mvn versions:set --batch-mode -DremoveSnapshot -DprocessAllModules | |
- name: Maven build | |
run: cd miranum-deployment && mvn --batch-mode install | |
- name: Release maven package | |
uses: samuelmeuli/action-maven-publish@v1 | |
with: | |
directory: miranum-deployment | |
gpg_private_key: ${{ secrets.PGP_PRIVATE_KEY }} | |
gpg_passphrase: ${{ secrets.PGP_PRIVATE_KEY_SECRET }} | |
nexus_username: ${{ secrets.NEXUS_USERNAME }} | |
nexus_password: ${{ secrets.NEXUS_PASSWORD }} | |
# docker | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_MIRAGON_USERNAME }} | |
password: ${{ secrets.DOCKER_MIRAGON_PASSWORD }} | |
- name: Set Release version env variable | |
run: | | |
echo "RELEASE_VERSION=$(cd miranum-deployment && mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Build and push miranum-deployment-service | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./miranum-deployment | |
push: true | |
tags: miragon/miranum-deployment-service:${{ env.RELEASE_VERSION }},miragon/miranum-deployment-service:latest | |
platforms: linux/amd64, linux/arm64/v8 |