-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
702cb6f
commit cf8e7ac
Showing
1 changed file
with
32 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,9 @@ | |
if: github.actor != 'pgoslatara' | ||
run: exit 1 | ||
|
||
- name: Only run from `main` | ||
if: github.ref_name != github.event.repository.default_branch | ||
run: exit 1 | ||
# - name: Only run from `main` | ||
# if: github.ref_name != github.event.repository.default_branch | ||
# run: exit 1 | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -70,22 +70,44 @@ | |
- name: Save version to env var | ||
id: version | ||
run: echo "version=$(poetry version --short)" >> $GITHUB_OUTPUT | ||
run: | | ||
echo "version=$(poetry version --short)" >> $GITHUB_OUTPUT | ||
echo "major=$(echo $(poetry version --short | cut -d '.' -f 1))" >> $GITHUB_OUTPUT | ||
echo "minor=$(echo $(poetry version --short | cut -d '.' -f 2))" >> $GITHUB_OUTPUT | ||
echo "patch=$(echo $(poetry version --short | cut -d '.' -f 3))" >> $GITHUB_OUTPUT | ||
- name: Determine if prerelease flag is necessary | ||
run: | | ||
[ "${{ inputs.version_bump_type }}" = "prerelease" ] && export PRERELEASE="--prerelease" || export PRERELEASE="--latest" | ||
echo "PRERELEASE: $PRERELEASE" | ||
echo PRERELEASE=$PRERELEASE >> "$GITHUB_ENV" | ||
- name: Tag commit and push | ||
run: | | ||
git config --globa user.email "[email protected]" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "github-actions[bot]" | ||
git tag -a ${{ steps.version.outputs.version }} -m "${{ steps.version.outputs.version }}" | ||
git push origin "${{ steps.version.outputs.version }}" | ||
git tag \ | ||
-a v${{ steps.version.outputs.version }} \ | ||
-m "v${{ steps.version.outputs.version }}" | ||
git push origin "v${{ steps.version.outputs.version }}" | ||
git tag \ | ||
-a v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }} \ | ||
-m "v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}" | ||
git push origin "v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}" | ||
git tag \ | ||
-a v${{ steps.version.outputs.major }} \ | ||
-m "v${{ steps.version.outputs.major }}" | ||
git push origin "v${{ steps.version.outputs.major }}" | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=raw,value=${{ steps.version.outputs.version }} | ||
type=raw,value=v${{ steps.version.outputs.version }} | ||
type=raw,value=v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }} | ||
type=raw,value=v${{ steps.version.outputs.major }} | ||
type=raw,value=${{ github.sha }} | ||
- name: Set up Docker Buildx | ||
|
@@ -117,20 +139,14 @@ | |
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Determine if prerelease flag is necessary | ||
run: | | ||
[ "${{ inputs.version_bump_type }}" = "prerelease" ] && export PRERELEASE="--prerelease" || export PRERELEASE="--latest" | ||
echo "PRERELEASE: $PRERELEASE" | ||
echo PRERELEASE=$PRERELEASE >> "$GITHUB_ENV" | ||
- name: Create release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh release create ${{ steps.version.outputs.version }} \ | ||
gh release create v${{ steps.version.outputs.version }} \ | ||
--generate-notes \ | ||
--repo ${{ github.repository }} \ | ||
--target main \ | ||
--title '${{ steps.version.outputs.version }}' \ | ||
--title 'v${{ steps.version.outputs.version }}' \ | ||
$PRELEASE \ | ||
--verify-tag |