Skip to content

Release on manual push #159

Release on manual push

Release on manual push #159

Workflow file for this run

name: Release on manual push
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version'
required: true
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{ inputs.release_version }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
docker-images: false
- uses: actions/checkout@v3
- name: Set version
run: |
sed -i "s/1.0.0-SNAPSHOT/${{ inputs.release_version }}/g" build.gradle.kts
- run: |
git tag v${{ inputs.release_version }}
git push --tags
- name: Setup cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle wrapper validation
uses: gradle/wrapper-validation-action@v3
- name: Running gradle build
uses: eskatos/gradle-command-action@v3
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
with:
arguments: build publish --no-daemon
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images (issuer)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-issuer-api/Dockerfile
tags: waltid/issuer-api:latest, waltid/issuer-api:${{ inputs.release_version }}
- name: Build and push Docker images (verifier)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-verifier-api/Dockerfile
tags: waltid/verifier-api:latest, waltid/verifier-api:${{ inputs.release_version }}
- name: Build and push Docker images (wallet-api)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-services/waltid-wallet-api/Dockerfile
tags: waltid/wallet-api:latest, waltid/wallet-api:${{ inputs.release_version }}
- name: Build and push Docker images (waltid-demo-wallet)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-wallet/apps/waltid-demo-wallet/Dockerfile
tags: waltid/waltid-demo-wallet:latest, waltid/waltid-demo-wallet:${{ inputs.release_version }}
- name: Build and push Docker images (waltid-dev-wallet)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-wallet/apps/waltid-dev-wallet/Dockerfile
tags: waltid/waltid-dev-wallet:latest, waltid/waltid-dev-wallet:${{ inputs.release_version }}
- name: Build and push Docker images (wallet-portal)
uses: docker/build-push-action@v6
with:
push: true
file: waltid-applications/waltid-web-portal/Dockerfile
tags: waltid/portal:latest, waltid/portal:${{ inputs.release_version }}
- name: Changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
with:
github-token: ${{ github.token }}
default-commit-type: Other Changes
release-name: v${{ inputs.release_version }}
mention-authors: true
mention-new-contributors: true
include-compare-link: true
use-github-autolink: true
semver: true
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.release_version }}
# body: |
# ${{ steps.changelog.outputs.changelog }}
prerelease: ${{ steps.changelog.outputs.prerelease }}
# issuer-api
- name: Prepare CD - issuer
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-issuer-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-issuer-api/k8s/deployment_mod.yaml
- name: Continuous deployment - issuer
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-services/waltid-issuer-api/k8s/deployment_mod.yaml
# verifier-api
- name: Prepare CD - verifier
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-verifier-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-verifier-api/k8s/deployment_mod.yaml
- name: Continuous deployment - verifier
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-services/waltid-verifier-api/k8s/deployment_mod.yaml
# wallet-api
- name: Prepare CD - wallet.walt.id
env:
PROD_KEYCLOAK_CLIENT_SECRET: ${{ secrets.PROD_KEYCLOAK_CLIENT_SECRET }}
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-services/waltid-wallet-api/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_KEYCLOAK_CLIENT_SECRET__/$PROD_KEYCLOAK_CLIENT_SECRET/g" |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-services/waltid-wallet-api/k8s/deployment_mod.yaml
- name: Continuous deployment - web wallet
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n default -f waltid-services/waltid-wallet-api/k8s/deployment_mod.yaml
# portal
- name: Prepare CD - portal.walt.id
run: sed "s/_DEFAULT_DEPLOYMENT_/$GITHUB_SHA/g" waltid-applications/waltid-web-portal/k8s/deployment-prod.yaml |
sed "s/__DEFAULT_IMAGE_TAG__/$IMAGE_TAG/g" > waltid-applications/waltid-web-portal/k8s/deployment_mod.yaml
- name: Continuous deployment - portal.walt.id
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: apply -n portals -f waltid-applications/waltid-web-portal/k8s/deployment_mod.yaml