Skip to content

Commit

Permalink
Merge pull request #245 from ernestojeda/automated-push-on-release
Browse files Browse the repository at this point in the history
ci: automate publishing of docker images to dockerhub
  • Loading branch information
madhavilosetty-intel authored Oct 4, 2023
2 parents 09c9f54 + 6b5dc3f commit 458fb5a
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 458fb5a

Please sign in to comment.