-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOP-55] CI for releases #9
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nwneisen Can we also run this workflow when a "Release" is created. Or is there a reason for using running it when a pre-release is created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can also be run for
published
instead.I use
prerelease
so that everything can be created and checked before it officially went out. It's just a last check for any small mistakes that stop the need for following up with a small fix release or if any automations run and try to pull the release artifacts before they are created.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea as what someone might use a
draft
release for except GHA has no support fordraft
releases