-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run CI on merge * Add a CI for the release process * Remove the 'v' and pushing 'sha' on release
- Loading branch information
Showing
6 changed files
with
111 additions
and
34 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
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,18 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [prereleased] | ||
|
||
jobs: | ||
vet: | ||
uses: ./.github/workflows/vet.yml | ||
unit-test: | ||
uses: ./.github/workflows/unit.yml | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
# TODO add integration tests | ||
push-to-ghcr: | ||
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }} # if all `needs` jobs are successful | ||
needs: [vet, unit-test, build] | ||
uses: ./.github/workflows/push-to-ghcr.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 |
---|---|---|
|
@@ -4,37 +4,75 @@ on: | |
workflow_call: | ||
|
||
jobs: | ||
# push-latest: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Load environment | ||
# uses: c-py/action-dotenv-to-setenv@v4 | ||
# with: | ||
# env-file: .github/development.env | ||
|
||
# - name: Log in to the Container registry | ||
# uses: docker/[email protected] | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Download artifact | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: ${{ env.IMAGE }} | ||
# path: /tmp | ||
|
||
# - name: Load docker image | ||
# working-directory: . | ||
# run: docker load --input /tmp/${{ env.IMAGE }}.tar | ||
|
||
# - name: Push latest image to ${{ env.REGISTRY }} | ||
# working-directory: . | ||
# run: make docker-push | ||
push-latest: | ||
if: ${{ github.event_name == 'release' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment | ||
uses: c-py/action-dotenv-to-setenv@v4 | ||
with: | ||
env-file: .github/development.env | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.IMAGE }} | ||
path: /tmp | ||
|
||
- name: Load docker image | ||
working-directory: . | ||
run: docker load --input /tmp/${{ env.IMAGE }}.tar | ||
|
||
- name: Push latest image to ${{ env.REGISTRY }} | ||
working-directory: . | ||
run: docker push ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:latest | ||
|
||
push-semver: | ||
if: ${{ github.event_name == 'release' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load environment | ||
uses: c-py/action-dotenv-to-setenv@v4 | ||
with: | ||
env-file: .github/development.env | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.IMAGE }} | ||
path: /tmp | ||
|
||
- name: Load docker image | ||
working-directory: . | ||
run: docker load --input /tmp/${{ env.IMAGE }}.tar | ||
|
||
- name: Push latest image to ${{ env.REGISTRY }} | ||
working-directory: . | ||
run: | | ||
SEMVER=${GITHUB_REF#refs/*/} | ||
echo ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$SEMVER | ||
docker tag ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:latest ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$SEMVER | ||
docker push ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$SEMVER | ||
push-sha: | ||
if: ${{ github.event_name == 'push' }} | ||
|
@@ -69,7 +107,7 @@ jobs: | |
working-directory: . | ||
run: | | ||
COMMIT_SHA=$(git rev-parse --short "$GITHUB_SHA") | ||
echo $COMMIT_SHA | ||
echo ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$COMMIT_SHA | ||
docker tag ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:latest ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$COMMIT_SHA | ||
docker push ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:$COMMIT_SHA | ||
|
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,19 @@ | ||
# Creating a release | ||
|
||
The release process is automated using github actions that trigger when a release is created on the github page. | ||
|
||
1. Open releases on the github page | ||
2. Create a pre-release which includes | ||
a. A tag for the latest commit on main. Use semantic versioning: `X.Y.Z` | ||
b. The auto generated changelog | ||
c. Check the pre-release box | ||
d. Publish the release | ||
3. CI will trigger and begin the release process | ||
a. Run through all tests (lint, unit, integration) | ||
b. Build the release images | ||
c. Publish the release images to | ||
i. ghcr.io/mirantis/boundless-operator:<tag> | ||
ii. ghcr.io/mirantis/boundless-operator:latest | ||
iii. ghcr.io/mirantis/boundless-operator:<commit SHA> | ||
4. Once CI finished, take a look at the images and make sure they look good | ||
5. Change the release from pre-release to latest on the github page |