-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from ernestojeda/automated-push-on-release
ci: automate publishing of docker images to dockerhub
- Loading branch information
Showing
1 changed file
with
32 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 |
---|---|---|
|
@@ -40,4 +40,35 @@ jobs: | |
extra_plugins: | | ||
@semantic-release/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get Next Version | ||
id: version | ||
run: | | ||
git fetch --tags | ||
echo "next=$(git tag | sort -r --version-sort | head -n1)" >> "$GITHUB_OUTPUT" | ||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
with: | ||
repository: open-amt-cloud-toolkit/e2e-testing | ||
ref: docker-release | ||
clean: true | ||
token: ${{ secrets.PROJECTS_PAT }} | ||
|
||
- name: Create docker-release @ ${{ steps.version.outputs.next }} | ||
env: | ||
RELEASE_YAML: release/rpc-go.yml | ||
NEXT_VERSION: ${{ steps.version.outputs.next }} | ||
run: | | ||
echo "Releasing ${{ github.repository }}@$NEXT_VERSION" | ||
if [ "$NEXT_VERSION" != "" ]; then | ||
CURRENT_VERSION=$(sed -nre 's/(.*):v[0-9]*(([0-9]+\.)*[0-9]+).*/v\2/p' $RELEASE_YAML) | ||
sed -i "s/$CURRENT_VERSION/$NEXT_VERSION/g" $RELEASE_YAML | ||
echo "=========================" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git status | ||
git add . | ||
git commit -m "release(rpc-go): automated release of $NEXT_VERSION @ ${GITHUB_SHA::7}" | ||
git push origin docker-release | ||
fi |