Release CE to DockerHub #50
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
name: Release CE to DockerHub | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version of kPow' | |
required: true | |
manifest: | |
description: 'URL of Manifest' | |
required: true | |
release_number_bump: | |
description: 'I have updated system.clj release number!' | |
required: true | |
default: 'false' | |
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
TagAndUpdateReleasesEdn: | |
runs-on: ubuntu-latest | |
name: Tag and update releases.edn | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check that we have bumped release number | |
run: | | |
./scripts/release_number_check.sh ${{github.event.inputs.release_number_bump}} | |
- name: Download and verify JAR(s) | |
run: | | |
./scripts/jar.sh "${{github.event.inputs.manifest}}" | |
- name: Configure AWS Credentials (OIDC) | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
aws-region: us-east-1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Release Kpow JDK8 Community JAR | |
run: | | |
VERSION=${{github.event.inputs.version}} | |
VERSION="${VERSION//./-}" | |
aws s3 cp target/kpow-ce-java8-standalone.jar s3://${{ secrets.RELEASES_BUCKET }}/kpow-ce-$VERSION-java8.jar | |
- | |
# Add support for more platforms with QEMU (optional) | |
# https://github.com/docker/setup-qemu-action | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and Push to DockerHub | |
run: | | |
NEXT_RELEASE=${{github.event.inputs.version}} | |
docker buildx build -f ./dockerfile/kpow-ce/Dockerfile --platform=linux/amd64,linux/arm64 -t factorhouse/kpow-ce:latest --push . | |
docker buildx build -f ./dockerfile/kpow-ce/Dockerfile --platform=linux/amd64,linux/arm64 -t factorhouse/kpow-ce:$NEXT_RELEASE --push . | |
- name: Install babashka | |
run: sudo bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install) | |
- name: Update releases-ce.edn | |
run: ./scripts/release.clj ${{github.event.inputs.version}} releases-ce.edn | |
- name: Update dockerhub/kpow-ce/README.md | |
run: echo ${{github.event.inputs.version}} | ./scripts/dockerhub_readme_ce.clj | |
- name: Commit | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "kPow CI" | |
git commit -am "Release Community ${{github.event.inputs.version}}" | |
- name: Deploy Manifest to s3 | |
run: | | |
aws s3 cp docs/releases-ce.edn s3://${{ secrets.RELEASES_BUCKET }}/releases-kpow-ce.edn \ | |
--cache-control no-cache --content-type application/edn | |
- name: Tag | |
run: git tag -a ce/${{github.event.inputs.version}} -m "Release Community ${{github.event.inputs.version}}" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |