-
Notifications
You must be signed in to change notification settings - Fork 54
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 367f5ee
Showing
49 changed files
with
3,964 additions
and
118 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 | ||
|
||
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 Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_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,72 @@ | ||
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 | ||
required: true | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: 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 Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_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 | ||
npm run release -w apps/${{ github.event.inputs.app }} -- $pre_release --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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
name: Validate and Build API | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
|
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,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
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,10 @@ | ||
{ | ||
"dependencies": { | ||
"@akashnetwork/env-loader": "1.0.1", | ||
"@akashnetwork/http-sdk": "1.0.7", | ||
"@akashnetwork/ui": "1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"dependencies": { | ||
"@akashnetwork/database": "1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"dependencies": { | ||
"@akashnetwork/ui": "1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"dependencies": { | ||
"@akashnetwork/ui": "1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@akashnetwork/dev-config": "1.0.0" | ||
} | ||
} |
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,51 @@ | ||
# Release Workflow Documentation | ||
|
||
## Overview | ||
|
||
This release workflow leverages **release-it**, **Docker**, **Docker Compose**, **GitHub Actions**, and a set of custom CLI bash scripts to manage the release process. The workflow adheres to **Semantic Versioning (SemVer)** and supports both beta pre-releases and final releases. | ||
|
||
## Release Flow | ||
|
||
The release process is divided into two key stages: pre-release (beta) and final release. This is done using SemVer conventions. | ||
|
||
### 1. Pre-Release (Beta) | ||
|
||
To create a **pre-release** (beta) version, the following command is used. This will create a beta version using the `release-it` tool with the specified options: | ||
|
||
```bash | ||
npm run release -w apps/$APP -- --preRelease=beta --verbose --ci -r $REGISTRY | ||
``` | ||
|
||
#### Key Options: | ||
- `--preRelease`: Marks the release as a beta pre-release. | ||
- `--verbose`: Provides detailed output for troubleshooting. | ||
- `--ci`: Ensures the release runs in a continuous integration environment. | ||
- `-r`: Registry to push the Docker image. | ||
|
||
### 2. Final Release | ||
|
||
For creating a final release, the command below is used. This will bump the version based on SemVer and push the release. | ||
|
||
```bash | ||
npm run release -w apps/$APP -- --verbose --ci -r $REGISTRY | ||
``` | ||
|
||
This should be run manually after validating the beta pre-release. Manual workflow is available in the GitHub Actions interface. | ||
|
||
## GitHub Actions Workflow | ||
|
||
### Pre-Release on Merge | ||
|
||
When a merge occurs on the `main` branch, a **beta** version is automatically created using GitHub Actions. The workflow is triggered by the merge event, ensuring that each change is reflected in a pre-release. | ||
|
||
### Manual Release | ||
|
||
Final releases are not triggered automatically. Instead, they are initiated manually via the GitHub Actions interface. This allows for flexibility in verifying and ensuring that the beta version is stable before creating an official release. | ||
|
||
## Customs scripts | ||
Scripts that are used in the release process are located in the `docker` package. These scripts are used to build Docker images, deploy services, and manage the release process. Check out the [README.md](../packages/docker/README.md) for more details. | ||
`release-it` config is also shared via local packages. | ||
|
||
## Roadmap | ||
- add alpha pre-release once development is provisioned | ||
- implement actual deployment to infra as currently only the Docker image is build and pushed |
Oops, something went wrong.