Skip to content

Commit

Permalink
Release/0.8.0 (#19)
Browse files Browse the repository at this point in the history
* renames ops tfvars

* /version 0.7.5-alpha.3

* /version 0.8.0-alpha.1

* add release workflow (#10)

* add release workflow

* update version artifact

* /version 0.8.0-alpha.2

* test artifacts

* test

* testing deploy artifacts

* /version 0.8.0-alpha.3

* update artifact and docker latest

* update env for docker tags

* update latest artifact tags

* /version 0.8.0-alpha.4

* add lowercase

* /version 0.8.0-alpha.5

* update latest docker tag (#17)

* /version 0.8.0-alpha.6

* Feature/deploy image cumulus (#18)

* update latest docker tag

* /version 0.8.0-alpha.3

* /version 0.8.0-alpha.4

* /version 0.8.0-alpha.5

* /version 0.8.0-alpha.6

* update github actions metadata actions

---------

Co-authored-by: sliu008 <[email protected]>
Co-authored-by: jamesfwood <[email protected]>

* /version 0.8.0-alpha.7

* release 0.8.0

* /version

* /version 0.8.0-rc.1

* Feature/deploy image cumulus (#20)

* update latest docker tag

* /version 0.8.0-alpha.3

* /version 0.8.0-alpha.4

* /version 0.8.0-alpha.5

* /version 0.8.0-alpha.6

* update github actions metadata actions

* add prerelease tags

---------

Co-authored-by: sliu008 <[email protected]>
Co-authored-by: jamesfwood <[email protected]>

* /version -alpha.1

* fix version

* /version -0.8.0-alpha.8

* fix version

* /version 0.8.0-alpha.8

* /version 0.8.0-rc.2

---------

Co-authored-by: Simon Liu <[email protected]>
Co-authored-by: sliu008 <[email protected]>
Co-authored-by: jamesfwood <[email protected]>
Co-authored-by: sliu008 <[email protected]>
Co-authored-by: podaac-forge bot <[email protected]>
  • Loading branch information
6 people authored Oct 17, 2023
1 parent b717307 commit 8afa924
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 36 deletions.
55 changes: 49 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
the_version=$(echo "${{ env.the_version }}" | sed -e "s/-alpha.*//g")
the_version=$(echo "$the_version" | sed -e "s/-rc.*//g")
new_version="${the_version}-$(git rev-parse --short HEAD)"
echo "the_version=${new_version}" >> $GITHUB_ENV
echo "software_version=${new_version}" >> $GITHUB_ENV
echo "new_version=${new_version}" >> $GITHUB_ENV
echo "Github REF: ${{ github.ref }}"
Expand Down Expand Up @@ -172,7 +173,7 @@ jobs:
# Update the version number in the application package itself
- name: Update version number in the application package
run: |
./gradlew setCurrentVersion -Pargs=${{ env.new_version }}
./gradlew setCurrentVersion -Pargs=${{ env.the_version }}
./gradlew currentVersion -q > .temp_version.out
new_version=$(cat .temp_version.out |grep -v Downloading |grep -v '%')
rm .temp_version.out
Expand Down Expand Up @@ -287,11 +288,21 @@ jobs:
# Publish release to releases
#########################################################################
- name: Upload Release Artifacts
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release') ||
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat' ||
github.event.head_commit.message == '/deploy sandbox'
uses: ncipollo/[email protected]
with:
tag: ${{ env.the_version }}
artifacts: "dist/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
body: "Version ${{ env.the_version }}"
makeLatest: "${{ github.ref == 'refs/heads/main' }}"
prerelease: "${{ github.ref != 'refs/heads/main' }}"

#########################################################################
# Build and Publish Docker Container
Expand All @@ -307,7 +318,8 @@ jobs:
- name: Deploy Env Override
if: |
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat'
github.event.head_commit.message == '/deploy uat' ||
github.event.head_commit.message == '/deploy sandbox'
run: |
message="${{ github.event.head_commit.message }}"
trimmed_message=${message:1} # Remove leading slash
Expand All @@ -316,14 +328,25 @@ jobs:
echo "THE_ENV=${override_env}" >> $GITHUB_ENV
echo "TARGET_ENV_UPPERCASE=${override_env_upper}" >> $GITHUB_ENV
- name: Lower Case Target Env
run: |
original_env_value="${TARGET_ENV_UPPERCASE}"
lowercase_value=$(echo "${original_env_value}" | tr '[:upper:]' '[:lower:]')
echo "TARGET_ENV_LOWERCASE=${lowercase_value}" >> $GITHUB_ENV
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ github.ref == 'refs/heads/main' }}
tags: |
type=semver,pattern={{version}},value=${{ env.the_version }}
type=raw,value=${{ env.THE_ENV }}
type=raw,value=${{ env.TARGET_ENV_LOWERCASE }}
- name: Show meta outputs
run: |
Expand All @@ -336,7 +359,8 @@ jobs:
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release') ||
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat'
github.event.head_commit.message == '/deploy uat' ||
github.event.head_commit.message == '/deploy sandbox'
uses: docker/build-push-action@v3
with:
context: .
Expand All @@ -346,7 +370,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Upload Docker image to ECR
- name: Upload Docker image to Service ECR
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
Expand All @@ -364,6 +388,25 @@ jobs:
create_repo: true
dockerfile: ./docker/Dockerfile

- name: Upload Docker image to Cumulus ECR
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release') ||
github.event.head_commit.message == '/deploy sit' ||
github.event.head_commit.message == '/deploy uat' ||
github.event.head_commit.message == '/deploy sandbox'
uses: vitr/actions-build-and-upload-to-ecs@master
with:
access_key_id: ${{ secrets[format('AWS_ACCESS_KEY_ID_CUMULUS_{0}', env.TARGET_ENV_UPPERCASE)] }}
secret_access_key: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_CUMULUS_{0}', env.TARGET_ENV_UPPERCASE)] }}
account_id: ${{ secrets[format('AWS_ACCOUNT_ID_CUMULUS_{0}', env.TARGET_ENV_UPPERCASE)] }}
repo: podaac/forge
region: us-west-2
tags: ${{ env.the_version }}
create_repo: true
dockerfile: ./docker/Dockerfile


#########################################################################
# Deploy to AWS via Terraform
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

name: Release Branch Created

# Run whenever a ref is created https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create
on:
create

jobs:
# First job in the workflow builds and verifies the software artifacts
bump:
name: Bump minor version on develop
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Only run if ref created was a release branch
if:
${{ startsWith(github.ref, 'refs/heads/release/') }}
steps:
# Checks-out the develop branch
- uses: actions/checkout@v2
with:
ref: 'refs/heads/develop'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Bump minor version
env:
COMMIT_VERSION: ${{ github.ref }}
run: |
# only update the develop branch if were making #.#.0 release
# Get the branch name from the GITHUB_REF environment variable
branch_name=${GITHUB_REF#refs/heads/}
# Extract the last number in the branch name using a regular expression
if [[ $branch_name =~ /([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
first_number=${BASH_REMATCH[1]}
middle_number=${BASH_REMATCH[2]}
last_number=${BASH_REMATCH[3]}
# Increment the middle number by 1
incremented_middle_number=$((middle_number + 1))
# Check if the last number is '0'
if [ "$last_number" == "0" ]; then
update_version=$first_number.$incremented_middle_number.$last_number-alpha.1
echo "software_version=$update_version" >> $GITHUB_ENV
./gradlew setCurrentVersion -Pargs=${{ env.software_version }}
git config --global user.name 'podaac-forge bot'
git config --global user.email '[email protected]'
git commit -am "/version ${{ env.software_version }}"
git push
fi
fi
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security


## [0.8.0]

### Added
- **Actions updates**
- Updated Github Actions to tag releases properly and deploy to Cumulus
### Changed
### Deprecated
### Removed
### Fixed
### Security


## [0.7.5]

### Added
### Changed
- **Moved repo to Github.com** -
- **Moved repo to Github.com**
- Repo moved here: https://github.com/podaac/forge
- Now builds and deploys in github.com Actions instead of Jenkins
### Deprecated
Expand Down
27 changes: 0 additions & 27 deletions Main.java

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Fri Sep 01 23:38:42 UTC 2023
version=0.7.5
#Mon Oct 09 20:41:38 UTC 2023
version=0.8.0-rc.2

0 comments on commit 8afa924

Please sign in to comment.