-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reference chainweb-node-docker workflow
- Loading branch information
1 parent
dab300e
commit 665db00
Showing
1 changed file
with
33 additions
and
64 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 |
---|---|---|
|
@@ -37,8 +37,14 @@ on: | |
default: false | ||
|
||
jobs: | ||
Finalize-release: | ||
release_vars: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RELEASE_SHA: ${{ steps.set-vars.outputs.RELEASE_SHA }} | ||
SHORT_REVISION: ${{ steps.set-vars.outputs.SHORT_REVISION }} | ||
VERSION_NEW: ${{ steps.set-vars.outputs.VERSION_NEW }} | ||
VERSION_OLD: ${{ steps.set-vars.outputs.VERSION_OLD }} | ||
IMAGE: ${{ steps.set-vars.outputs.IMAGE }} | ||
steps: | ||
# if this plugin is bad we just override it | ||
# - name: Bump version and push tag | ||
|
@@ -54,66 +60,40 @@ jobs: | |
# yeah that thing is for rapid releasing tbh | ||
|
||
- name: Set environment variables for release | ||
id: set-vars | ||
run: | | ||
RELEASE_SHA=${{ github.sha }} | ||
if [[ ! -z ${{ inputs.release_sha }} ]]; then | ||
RELEASE_SHA=${{ inputs.release_sha }} | ||
fi | ||
echo "RELEASE_SHA=$RELEASE_SHA" >> $GITHUB_ENV | ||
echo "RELEASE_SHA=$RELEASE_SHA" >> $GITHUB_OUTPUT | ||
SHORT_REVISION=$(echo $RELEASE_SHA | cut -c 1-7) | ||
echo "SHORT_REVISION=$SHORT_REVISION" >> $GITHUB_ENV | ||
#echo "VERSION_NEW=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_ENV | ||
#echo "VERSION_OLD=${{ steps.tag_version.outputs.old_tag }}" >> $GITHUB_ENV | ||
echo "VERSION_NEW=${{ inputs.new_tag }}" >> $GITHUB_ENV | ||
echo "VERSION_OLD=${{ inputs.old_tag }}" >> $GITHUB_ENV | ||
echo "IMAGE=ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION" >> $GITHUB_ENV | ||
echo "SHORT_REVISION=$SHORT_REVISION" >> $GITHUB_OUTPUT | ||
# echo "VERSION_NEW=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT | ||
# echo "VERSION_OLD=${{ steps.tag_version.outputs.old_tag }}" >> $GITHUB_OUTPUT | ||
echo "VERSION_NEW=${{ inputs.new_tag }}" >> $GITHUB_OUTPUT | ||
echo "VERSION_OLD=${{ inputs.old_tag }}" >> $GITHUB_OUTPUT | ||
echo "IMAGE=ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION" >> $GITHUB_OUTPUT | ||
echo $GITHUB_ENV | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: kadena-io/chainweb-node-docker | ||
path: dockerhub | ||
ssh-key: ${{ secrets.GH_DEPLOYKEY_CHAINWEBDOCKER }} | ||
|
||
#- name: derive release id from branch name? | ||
# if this was a release branch we'd do this to override the inputs | ||
# first run we are releasing from master (release branch kinda not needed if we just force release build logic during 'freeze') | ||
# The release actions out there sometimes will just do this increment for us | ||
- name: UBUNTU IMAGE bump end-user docker image | ||
working-directory: dockerhub | ||
continue-on-error: true | ||
run: | | ||
echo "DOCKERHUB_SHA=not yet updated" >> $GITHUB_ENV | ||
git clone https://github.com/kadena-io/chainweb-node-docker | ||
sed -i -e "s/ARG REVISION=.*/ARG REVISION=$SHORT_REVISION/" Dockerfile | ||
docker build -t kadena/chainweb-node:$VERSION_NEW . | ||
docker run --rm kadena/chainweb-node:$VERSION_NEW ./chainweb-node --version | ||
git config --local user.name "github-actions[chainweb-node release]" | ||
git config --local user.email "[email protected]" | ||
git add Dockerfile | ||
git commit -m "chainweb-node version $VERSION_NEW" | ||
git tag chainweb-$VERSION_NEW | ||
git push | ||
git push origin chainweb-$VERSION_NEW | ||
echo ${{ secrets.DOCKERHUB_PAT }} | docker login docker.io --username ${{ secrets.DOCKERHUB_USER }} --password-stdin | ||
docker tag kadena/chainweb-node:$VERSION_NEW kadena/chainweb-node:latest | ||
docker image push --all-tags kadena/chainweb-node | ||
## spit these to output | ||
digest1=$(docker inspect kadena/chainweb-node:$VERSION_NEW --format '{{ .RepoDigests }}') | ||
digest2=$(docker inspect kadena/chainweb-node:latest --format '{{ .RepoDigests }}') | ||
if [[ $digest1 != $digest2 ]]; then | ||
echo "DOCKERHUB_SHA=sha mismatches in dockerhub image" >> $GITHUB_ENV | ||
exit 1 | ||
fi | ||
echo "DOCKERHUB_SHA=$digest1" >> $GITHUB_ENV | ||
# all of this should really just be a BUMP IMAGE VERSION step in the other repo | ||
# Now in this workflow, trigger the above, spit output into release notes file | ||
chainweb_node_docker: | ||
uses: kadena-io/chainweb-node-docker/.github/workflows/dockerhub_release.yml | ||
needs: release_vars | ||
with: | ||
SHORT_SHA: ${{ needs.release_vars.outputs.SHORT_REVISION }} | ||
VERSION_NEW: ${{ needs.release_vars.outputs.VERSION_NEW }} | ||
secrets: inherit | ||
|
||
release_repo: | ||
needs: release_vars | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE: ${{ needs.release_vars.outputs.IMAGE }} | ||
SHORT_REVISION: ${{ needs.release_vars.outputs.SHORT_REVISION }} | ||
VERSION_NEW: ${{ needs.release_vars.outputs.VERSION_NEW }} | ||
VERSION_OLD: ${{ needs.release_vars.outputs.VERSION_OLD }} | ||
RELEASE_SHA: ${{ needs.release_vars.outputs.RELEASE_SHA }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.RELEASE_SHA }} | ||
|
@@ -133,10 +113,6 @@ jobs: | |
|
||
- name: retag ghcr docker images | ||
continue-on-error: true | ||
env: | ||
IMAGE: ${{ env.IMAGE }} | ||
SHORT_REVISION: ${{ env.SHORT_REVISION }} | ||
VERSION_NEW: ${{ env.VERSION_NEW }} | ||
run: | | ||
docker pull $IMAGE | ||
docker run --rm $IMAGE --version | ||
|
@@ -160,9 +136,6 @@ jobs: | |
- name: run release script to generate images | ||
id: repack-binaries | ||
env: | ||
SHORT_REVISION: ${{ env.SHORT_REVISION }} | ||
VERSION_NEW: ${{ env.VERSION_NEW }} | ||
run: | | ||
GHC_VER=9.6.2 | ||
|
@@ -203,10 +176,6 @@ jobs: | |
env: | ||
UBUNTU_22_NODE: ${{ env.UBUNTU_22_NODE }} | ||
UBUNTU_20_NODE: ${{ env.UBUNTU_20_NODE }} | ||
IMAGE: ${{ env.IMAGE }} | ||
SHORT_REVISION: ${{ env.SHORT_REVISION }} | ||
VERSION_NEW: ${{ env.VERSION_NEW }} | ||
VERSION_OLD: ${{ env.VERSION_OLD }} | ||
GHCR_DIGEST: ${{ env.GHCR_DIGEST }} | ||
run: | | ||
pwd | ||
|