Skip to content

Commit

Permalink
feat: add cd in one branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Samika Kashyap committed Jan 18, 2024
1 parent 20e66c6 commit 4d87b37
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: ["dev"]
tags: ["deploy-*"]

# trigger for release ? -> deploy to tnet / prod
#

env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
55 changes: 10 additions & 45 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# TODO : Figure out how to pass teh appropriate levels, to the pre-release script.
# TODO : Clean up whatever is not necessary
name: Create pre-release
# TODO : Clean up whatever is not necessary in other workflows
name: Create pre-release and releases

on:
workflow_dispatch:
inputs:
environment:
release-type:
type: choice
description: Infrastructure environment to deploy to
required: true
default: dev
default: tnet
options:
- tnet
- prod
- pre-release
- release

level:
description: 'Release level'
Expand All @@ -24,44 +23,8 @@ on:
- minor
- major

# tag:
# type: string
# description: Tag to deploy
# required: true

# env:
# AWS_REGION: ${{ secrets.AWS_REGION }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
# deploy:
# runs-on: ubuntu-latest
# steps:
# -
# uses: actions/checkout@v3
# # -
# # name: Schedule ECS deployment
# # run: |
# # deploy_env="${{ github.event.inputs.environment }}"
# # deploy_target="release"
# # deploy_tag="${{ github.event.inputs.tag }}"
# # if [[ ${{ github.event.inputs.type == 'commit' }} == 'true' ]]; then
# # # For commit deployments, the target is the same as the tag (i.e. the commit hash).
# # deploy_target="$deploy_tag"
# # fi
# # make DEPLOY_ENV="$deploy_env" DEPLOY_TARGET="$deploy_target" DEPLOY_TAG="$deploy_tag" MANUAL_DEPLOY="true" schedule-ecs-deployment
# -
# name: Schedule k8s deployment
# run: |
# deploy_env="${{ github.event.inputs.environment }}"
# deploy_tag="${{ github.event.inputs.tag }}"
# # If this workflow was run for a release, indicate that this is a release deployment.
# if [[ ${{ contains(github.event.head_commit.message, 'chore: Release') }} == 'true' ]]; then
# deploy_tag=$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version' | tr -d '"')
# fi
# make DEPLOY_ENV="$deploy_env" DEPLOY_TAG="$deploy_tag" schedule-k8s-deployment


pre-release:
runs-on: ubuntu-latest
steps:
Expand All @@ -70,5 +33,7 @@ jobs:
-
name: Run Pre-release
run: |
make PRE_RELEASE_ENV="${{ github.event.inputs.environment }}" PRE_RELEASE_LEVEL="${{ github.event.inputs.level }}" pre-release
make PRE_RELEASE_ENV="${{ github.event.inputs.release-type }}" PRE_RELEASE_LEVEL="${{ github.event.inputs.level }}" pre-release
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:

on:
push:
branches: [ "main" ]
branches: [ "dev, rc, main" ]
paths:
- 'Cargo.toml'

Expand Down
4 changes: 2 additions & 2 deletions ci-scripts/pre-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ set -e
# Ensure we are in the git root
cd $(git rev-parse --show-toplevel)

# SDetermine the release level and the deployment type
level=$2
# Determine the release level and the deployment type
env=$1
level=$2

# Bump crate versions
cargo release version $level \
Expand Down
11 changes: 6 additions & 5 deletions ci-scripts/release_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ cargo update -p ceramic-api-server
# Commit the specified packages
# `cargo release commit` currently fails to build a good commit message.
# Using git commit directly for now
branch="release-v${version}"
git checkout -b "$branch"
msg="chore: release version v${version}"
git commit -am "$msg"
git push --set-upstream origin $branch
# branch="release-v${version}"
# git checkout -b "$branch"
# msg="chore: release version v${version}"
# git commit -am "$msg"
# git push --set-upstream origin $branch

# Create a PR
# This is the github CLI command being run, same syntax to publish a release/pre-release for github CLI
gh pr create \
--base main \
--head "$branch" \
Expand Down

0 comments on commit 4d87b37

Please sign in to comment.