-
Notifications
You must be signed in to change notification settings - Fork 171
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
Automatic semantic versioning #593
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0473cfc
Update node makefile
pschork ee81880
Add release workflow
pschork a8e1fe7
Testing workflow
pschork b7d1263
Update release docker repository
pschork 1d3b524
Fix tag regex
pschork 97ee5b7
Add force flag to workflow for manually triggered untagged releases
pschork 492d65b
Remove old publish workflow
pschork 07cd3cc
Remove dev branch from workflow
pschork 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 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,78 @@ | ||
name: docker-publish-release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
pull_request: | ||
workflow_dispatch: | ||
inputs: | ||
force: | ||
description: "Force untagged release (expert mode)" | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
CACHE-FROM: /tmp/.buildx-cache | ||
CACHE-TO: /tmp/.buildx-cache-new | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: Determine SemVer | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
|
||
- run: | | ||
echo "SemVer ${{ env.fullSemVer }} Forced ${{ github.event.inputs.force }}" | ||
name: Display SemVer | ||
|
||
- name: Setup Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
install: true | ||
driver-opts: image=moby/buildkit:master | ||
|
||
- name: Cache docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
if: ${{ success() }} | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
if: ${{ success() }} | ||
|
||
# Build And Push Image | ||
- name: Build docker image release | ||
run: make docker-release-build | ||
if: ${{ success() }} | ||
|
||
# Publish if release is tagged or force == true | ||
- name: Push docker image release | ||
run: make docker-release-push | ||
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.force == 'true' |
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,29 @@ | ||
increment: None | ||
branches: | ||
main: | ||
mode: ContinuousDelivery | ||
tag: pre | ||
increment: Patch | ||
prevent-increment-of-merged-branch-version: true | ||
track-merge-target: false | ||
regex: ^master$|^main$ | ||
source-branches: | ||
- release | ||
tracks-release-branches: true | ||
is-release-branch: false | ||
is-mainline: true | ||
pre-release-weight: 55000 | ||
release: | ||
mode: ContinuousDelivery | ||
tag: rc | ||
increment: None | ||
prevent-increment-of-merged-branch-version: true | ||
track-merge-target: false | ||
regex: ^v*|^releases?[/-] | ||
source-branches: | ||
- main | ||
- release | ||
tracks-release-branches: false | ||
is-release-branch: true | ||
is-mainline: false | ||
pre-release-weight: 30000 |
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,12 @@ | ||
# This file is used for building and pushing images | ||
services: | ||
node: | ||
build: | ||
context: . | ||
dockerfile: node/cmd/Dockerfile | ||
image: ghcr.io/layr-labs/eigenda/opr-node:${RELEASE_TAG} | ||
nodeplugin: | ||
build: | ||
context: . | ||
dockerfile: node/plugin/cmd/Dockerfile | ||
image: ghcr.io/layr-labs/eigenda/opr-nodeplugin:${RELEASE_TAG} |
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
Oops, something went wrong.
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.
What's the usecase for pushing an untagged release?
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.
Allows someone to release a feature branch for debugging. Running the workflow manually should be rare.