-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Complete rework of CI/CD pipeline
- Loading branch information
1 parent
aaceee5
commit e2ad084
Showing
57 changed files
with
27,739 additions
and
612 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: build-app-setup | ||
description: Sets up the environment for the app build action | ||
inputs: | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ${{ inputs.app-path }}/node-version | ||
cache: npm | ||
cache-dependency-path: ${{ inputs.app-path }} | ||
- id: setup-npm | ||
shell: bash | ||
run: (cd ${{ inputs.app-path }}; npm ci) | ||
- id: setup-fs | ||
shell: bash | ||
run: cp README.md LICENSE ${{ inputs.app-path }}/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: build-app | ||
description: Builds the JS application and uploads the artifact | ||
inputs: | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
artifact-name: | ||
description: The name of the uploaded app artifact | ||
required: false | ||
default: app-artifact | ||
runs: | ||
using: composite | ||
steps: | ||
- id: build-app | ||
shell: bash | ||
run: (cd ${{ inputs.app-path }}; npm run build) | ||
- id: package-artifact | ||
shell: bash | ||
run: | | ||
fileName=$(cd ${{ inputs.app-path }}; npm pack) | ||
mv ${{ inputs.app-path }}/$fileName npm-pack.tgz | ||
- id: upload-artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: npm-pack.tgz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: build-docker-setup | ||
description: Sets up the environment for cross platform docker build action | ||
inputs: | ||
docker-path: | ||
description: The path to the docker directory | ||
required: false | ||
default: docker | ||
app-artifact-name: | ||
description: The name of the uploaded app artifact | ||
required: false | ||
default: app-artifact | ||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-qemu | ||
uses: docker/setup-qemu-action@v2 | ||
- id: setup-buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- id: setup-app-artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.app-artifact-name }} | ||
path: ${{ inputs.docker-path }}/rootfs/opt/ | ||
- id: debug | ||
shell: bash | ||
run: ls -al ${{ inputs.docker-path }}/rootfs/opt/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: build-docker | ||
description: Builds the cross platform docker containers and uploads the artifact | ||
inputs: | ||
docker-path: | ||
description: The path to the docker directory | ||
required: false | ||
default: docker | ||
artifact-name: | ||
description: The name of the uploaded docker artifact | ||
required: false | ||
default: docker-artifact | ||
runs: | ||
using: composite | ||
steps: | ||
- id: get-docker-metadata | ||
uses: ./.github/actions/helper/docker-metadata | ||
- id: build-rootfs | ||
shell: bash | ||
run: tar -C ${{ inputs.docker-path }}/rootfs -czf ${{ inputs.docker-path }}/rootfs.tar.gz ./ | ||
- id: build-docker-amd64 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ inputs.docker-path }} | ||
platforms: linux/amd64 | ||
tags: ${{ steps.get-docker-metadata.outputs.image-namespace }}/${{ steps.get-docker-metadata.outputs.image-repository }}:${{ steps.get-docker-metadata.outputs.image-tag }} | ||
outputs: type=docker,dest=docker-amd64.tar | ||
- id: build-docker-arm64 | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ inputs.docker-path }} | ||
platforms: linux/arm64 | ||
tags: ${{ steps.get-docker-metadata.outputs.image-namespace }}/${{ steps.get-docker-metadata.outputs.image-repository }}:${{ steps.get-docker-metadata.outputs.image-tag }} | ||
outputs: type=docker,dest=docker-arm64.tar | ||
- id: package-artifact | ||
shell: bash | ||
run: | | ||
mkdir docker-artifact | ||
gzip docker-*.tar | ||
mv docker-*.tar.gz docker-artifact/ | ||
echo "artifact-path=docker-artifact/" >> $GITHUB_OUTPUT | ||
- name: upload-artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: ${{ steps.package-artifact.outputs.artifact-path }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: build-docs-setup | ||
description: Sets up the environment for the docs build action using mkdocs | ||
inputs: | ||
docs-path: | ||
description: The path to the mkdocs directory | ||
required: false | ||
default: docs | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
app-artifact-name: | ||
description: The name of the uploaded app artifact | ||
required: false | ||
default: app-artifact | ||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
cache: pip | ||
cache-dependency-path: ${{ inputs.docs-path }} | ||
- id: setup-pip | ||
shell: bash | ||
run: pip install -r ${{ inputs.docs-path }}/requirements.txt | ||
- id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ${{ inputs.app-path }}/node-version | ||
- id: download-app-artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.app-artifact-name }} | ||
path: ${{ inputs.app-path }} | ||
- id: install-app-artifact | ||
shell: bash | ||
run: | | ||
tree -a ${{ inputs.app-path }} | ||
npm install -g ./${{ inputs.app-path }}/npm-pack.tgz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: build-docs | ||
description: Builds the docs using mkdocs | ||
inputs: | ||
docs-path: | ||
description: The path to the docs directory | ||
required: false | ||
default: docs | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
runs: | ||
using: composite | ||
steps: | ||
- id: get-docs-config | ||
shell: bash | ||
run: | | ||
echo "site-dir=$(grep -oP "site_dir: '\K.+'" ${{ inputs.docs-path }}/mkdocs.yml | head -c-2)" >> $GITHUB_OUTPUT | ||
echo "docs-dir=$(grep -oP "docs_dir: '\K.+'" ${{ inputs.docs-path }}/mkdocs.yml | head -c-2)" >> $GITHUB_OUTPUT | ||
- id: get-npm-metadata | ||
uses: ./.github/actions/helper/npm-metadata | ||
with: | ||
package: ${{ inputs.app-path }}/package.json | ||
- id: setup-fs | ||
shell: bash | ||
run: cp README.md LICENSE ${{ inputs.docs-path }}/${{ steps.get-docs-config.outputs.docs-dir }}/ | ||
- id: build-cli-reference | ||
shell: bash | ||
run: ${{ github.action_path }}/build_cli.sh "${{ inputs.docs-path }}/${{ steps.get-docs-config.outputs.docs-dir }}" "${{ steps.get-npm-metadata.outputs.command }}" | ||
- id: build-mkdocs | ||
shell: bash | ||
run: (cd ${{ inputs.docs-path }}; mkdocs build) | ||
- id: bundle-coverage | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
name: coverage-artifact | ||
path: ${{ inputs.docs-path }}/${{ steps.get-docs-config.outputs.site-dir }}/dev/coverage | ||
workflow: event_pr.yml | ||
workflow_conclusion: "" | ||
branch: beta | ||
if_no_artifact_found: warn | ||
- id: upload-artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ${{ inputs.docs-path }}/${{ steps.get-docs-config.outputs.site-dir }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
OUT_FILE="$1/user-guides/cli.md" | ||
BIN="$2" | ||
> $OUT_FILE | ||
|
||
echo '# CLI Reference' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
$BIN --help >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
|
||
echo '## `token` command' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
$BIN token --help >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
|
||
echo '## `sync` command' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
$BIN sync --help >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
|
||
echo '## `archive` command' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
$BIN archive --help >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
|
||
echo '## `daemon` command' >> $OUT_FILE | ||
echo '' >> $OUT_FILE | ||
echo '```' >> $OUT_FILE | ||
$BIN daemon --help >> $OUT_FILE | ||
echo '```' >> $OUT_FILE |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: build-wiki-setup | ||
description: Sets up the environment for the wiki build action | ||
inputs: | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
runs: | ||
using: composite | ||
steps: | ||
- id: setup-node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ${{ inputs.app-path }}/node-version | ||
cache: npm | ||
cache-dependency-path: ${{ inputs.app-path }} | ||
- id: setup-npm | ||
shell: bash | ||
run: (cd ${{ inputs.app-path }}; npm ci) | ||
- id: setup-fs | ||
shell: bash | ||
run: cp README.md LICENSE ${{ inputs.app-path }}/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: build-wiki | ||
description: Builds the Github Wiki Pages and uploads the artifact | ||
inputs: | ||
app-path: | ||
description: The path to the app directory | ||
required: false | ||
default: app | ||
artifact-name: | ||
description: The name of the uploaded wiki artifact | ||
required: false | ||
default: wiki-artifact | ||
runs: | ||
using: composite | ||
steps: | ||
- id: build-typedoc | ||
shell: bash | ||
run: (cd ${{ inputs.app-path }}; npx typedoc) | ||
- id: package-artifact | ||
shell: bash | ||
run: | | ||
outDir=$(cat ${{ inputs.app-path }}/typedoc.json | jq -r .out) | ||
echo "artifact-path=${{ inputs.app-path }}/$outDir" >> $GITHUB_OUTPUT | ||
- name: upload-artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: ${{ steps.package-artifact.outputs.artifact-path }} |
20 changes: 20 additions & 0 deletions
20
.github/actions/helper/clean-after-prod-release/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: clean-after-prod-release | ||
description: Merges the tags from the main branch to the dev branch and clears nightly tags | ||
inputs: | ||
gh-token: | ||
description: The Github token | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- id: merge-main-to-dev | ||
uses: devmasx/merge-branch@master | ||
with: | ||
type: now | ||
from_branch: main | ||
target_branch: dev | ||
message: merge main into dev | ||
github_token: ${{ inputs.gh-token }} | ||
- id: clear-nightly-tags | ||
shell: bash | ||
run: git push origin --delete $(git tag -l "$(git describe --tags --abbrev=0)-nightly*") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: clear-git-tag | ||
description: Removes the provided git tag from the remote repository | ||
inputs: | ||
git-tag: | ||
description: The git tag to remove | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- id: get-config | ||
if: inputs.git-tag != '' | ||
shell: bash | ||
run: git push --delete origin ${{ inputs.git-tag }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: docker-metadata | ||
description: Retrieves the relevant Docker metadata | ||
outputs: | ||
image-namespace: | ||
description: The image namespace for CI built Docker images | ||
value: ${{ steps.get-config.outputs.image-namespace }} | ||
image-repository: | ||
description: The image repository name for CI built Docker images | ||
value: ${{ steps.get-config.outputs.image-repository }} | ||
image-tag: | ||
description: The image tag for CI built Docker images | ||
value: ${{ steps.get-config.outputs.image-tag }} | ||
runs: | ||
using: composite | ||
steps: | ||
- id: get-config | ||
shell: bash | ||
run: | | ||
echo "image-namespace=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | ||
echo "image-repository=${{ github.event.repository.name }}" >> $GITHUB_OUTPUT | ||
echo "image-tag=latest-ci-build" >> $GITHUB_OUTPUT |
Oops, something went wrong.