-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(release): implement release with image build
- Loading branch information
1 parent
b39b057
commit 4db618f
Showing
56 changed files
with
4,163 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,9 @@ | |
"billing", | ||
"provider", | ||
"deployment", | ||
"certificate", | ||
"dx" | ||
"dx", | ||
"release", | ||
"certificate" | ||
] | ||
] | ||
} | ||
|
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,54 @@ | ||
name: Deploy to akash | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'console-*/v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' | ||
- 'console-*/v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
define-vars: | ||
name: Define Variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
app: ${{ steps.vars.outputs.app }} | ||
image: ${{ steps.vars.outputs.image }} | ||
steps: | ||
- name: Set app name | ||
id: vars | ||
run: | | ||
API_REGISTRY="ghcr.io/akashnetwork/console-api" | ||
WEB_REGISTRY="ghcr.io/akashnetwork/console-web" | ||
API_WORKSPACE="apps/api" | ||
WEB_WORKSPACE="apps/deploy-web" | ||
FULL_TAG="${GITHUB_REF#refs/tags/}" | ||
IFS='/' read -r scope version <<< "$FULL_TAG" | ||
prerelease_type=$(echo "$version" | sed -n 's/.*-\([a-zA-Z]*\).*/\1/p') | ||
app="${scope#console-}" | ||
registry_var="$(echo "$app" | tr '[:lower:]' '[:upper:]')_REGISTRY" | ||
registry="${!registry_var}" | ||
workspace_var="$(echo "$app" | tr '[:lower:]' '[:upper:]')_WORKSPACE" | ||
workspace="${!workspace_var}" | ||
app="${scope#console-}-${prerelease_type:-stable}" | ||
version="${version#v}" | ||
echo "::set-output name=workspace::$workspace" | ||
echo "::set-output name=app::$app" | ||
echo "::set-output name=version::$version" | ||
echo "::set-output name=image::$image" | ||
deploy-akash: | ||
name: Deploy to akash | ||
uses: ygrishajev/akash-deploy-action/.github/workflows/deploy.yml@main | ||
with: | ||
PROJECT_PATH: app/apps/${{ define-vars.outputs.workspace }} | ||
project_name: ${{ define-vars.outputs.app }} | ||
image: ${{ define-vars.outputs.image }} | ||
secrets: | ||
SEED: ${{ secrets.WALLET_MNEUMONIC }} | ||
PASSWORD: ${{ secrets.WALLET_PASSWORD }} | ||
ghcr-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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
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,54 @@ | ||
name: Release All Apps | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.14.0 | ||
|
||
- name: Restore root node_modules cache | ||
uses: martijnhols/actions-cache@v3 | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Docker images | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Akash Network Team" | ||
npm run release -w apps/api -- --preRelease=beta --verbose --ci -r ${{ secrets.API_REGISTRY }} | ||
npm run release -w apps/deploy-web -- --preRelease=beta -f --verbose --ci -r ${{ secrets.WEB_REGISTRY }} |
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,82 @@ | ||
name: Release App | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
app: | ||
type: choice | ||
description: Which app to release | ||
options: | ||
- api | ||
- deploy-web | ||
required: true | ||
release-type: | ||
type: choice | ||
description: Which app to release | ||
options: | ||
- stable | ||
- beta | ||
default: stable | ||
force-build: | ||
type: boolean | ||
description: Rebuild the Docker image | ||
default: false | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.14.0 | ||
|
||
- name: Restore root node_modules cache | ||
uses: martijnhols/actions-cache@v3 | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the Docker images | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Akash Network Team" | ||
pre_release="" | ||
if [[ "${{ github.event.inputs.release-type }}" == 'beta' ]]; then | ||
prerelease="--preRelease=beta" | ||
fi | ||
force_build="" | ||
if [[ "${{ github.event.inputs.force-build }}" == 'true' ]]; then | ||
force_build="-f" | ||
fi | ||
npm run release -w apps/${{ github.event.inputs.app }} -- $pre_release $force_build --verbose --ci -r ${{ secrets.API_REGISTRY }} |
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,4 @@ | ||
if [[ "$CI" != "true" ]]; then | ||
npm run update-apps-local-deps | ||
git add --all | ||
fi |
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 @@ | ||
module.exports = require("@akashnetwork/releaser") |
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,29 @@ | ||
#!/bin/bash | ||
|
||
# Enable debugging (prints each command as it's executed) | ||
#set -x | ||
|
||
API_REGISTRY="ghcr.io/akashnetwork/console-api" | ||
WEB_REGISTRY="ghcr.io/akashnetwork/console-web" | ||
API_WORKSPACE="apps/api" | ||
WEB_WORKSPACE="apps/deploy-web" | ||
|
||
FULL_TAG="${GITHUB_REF#refs/tags/}" | ||
IFS='/' read -r scope version <<< "$FULL_TAG" | ||
prerelease_type=$(echo "$version" | sed -n 's/.*-\([a-zA-Z]*\).*/\1/p') | ||
app="${scope#console-}" | ||
|
||
registry_var="$(echo "$app" | tr '[:lower:]' '[:upper:]')_REGISTRY" | ||
registry="${!registry_var}" | ||
|
||
workspace_var="$(echo "$app" | tr '[:lower:]' '[:upper:]')_WORKSPACE" | ||
workspace="${!workspace_var}" | ||
|
||
app="${scope#console-}-${prerelease_type:-stable}" | ||
version="${version#v}" | ||
|
||
# Print the final results | ||
echo "App: $app" | ||
echo "workspace: $workspace" | ||
echo "Version: $version" | ||
echo "Registry: $registry" |
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,9 @@ | ||
{ | ||
"dependencies": { | ||
"@akashnetwork/database": "1.0.0", | ||
"@akashnetwork/http-sdk": "1.0.7" | ||
}, | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
Empty 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
Oops, something went wrong.