-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: create releases with Release Please
resolves #346
- Loading branch information
1 parent
f3ba6db
commit 5f045e4
Showing
5 changed files
with
91 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release SILO | ||
|
||
on: | ||
workflow_run: | ||
workflows: [LAPIS-SILO] | ||
types: [completed] | ||
branches: [main] | ||
|
||
env: | ||
DOCKER_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
packages: write | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'GenSpectrum/LAPIS-SILO' }} | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
id: release | ||
with: | ||
path: . | ||
config-file: release-please-config.json | ||
manifest-file: .release-please-manifest.json | ||
target-branch: main | ||
|
||
- name: Inspect Release Outputs | ||
run: | | ||
cat <<'EOF' | ||
${{ toJson(steps.release.outputs) }} | ||
EOF | ||
- uses: actions/checkout@v4 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Set up Docker Buildx | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Tag Already Built Images With Release Tags | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
MAJOR=${{ steps.release.outputs.major }} | ||
MINOR=${{ steps.release.outputs.minor }} | ||
PATCH=${{ steps.release.outputs.patch }} | ||
TAGS=("$MAJOR.$MINOR" "$MAJOR.$MINOR.$PATCH") | ||
# TODO (#405) include $MAJOR only for releases >= 1.0 | ||
# TAGS=("$MAJOR" "$MAJOR.$MINOR" "$MAJOR.$MINOR.$PATCH") | ||
for TAG in "${TAGS[@]}"; do | ||
docker buildx imagetools create --tag $DOCKER_IMAGE_NAME:$TAG $DOCKER_IMAGE_NAME:latest | ||
done |
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,3 @@ | ||
{ | ||
".": "0.0.1" | ||
} |
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,9 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"release-type": "simple" | ||
} | ||
}, | ||
"bump-minor-pre-major": true, | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" | ||
} |
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 @@ | ||
0.0.1 |