Skip to content

Add GCPInstanceService which used to monitor and suspend gcp instance… #36

Add GCPInstanceService which used to monitor and suspend gcp instance…

Add GCPInstanceService which used to monitor and suspend gcp instance… #36

name: Build jars
on:
workflow_dispatch:
push:
tags:
- "extender-v[0-9]+.[0-9]+.[0-9]+"
- "client-v[0-9]+.[0-9]+.[0-9]+"
- "manifestmergetool-v[0-9]+.[0-9]+.[0-9]+"
env:
GOOGLE_ARTIFACT_REGISTRY: europe-west1-docker.pkg.dev
MAVEN_SERVICE_ACCOUNT: [email protected]
jobs:
client:
if: ${{ startsWith(github.ref_name, 'client-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Generate version
id: version
run: |
SHORT_SHA="$(echo ${GITHUB_SHA} | cut -c1-8)"
TAG_NAME=${{ github.ref_name }}
TAG_VERSION="${TAG_NAME#*-v}"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Login to Google Artifact registry (Maven)
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa
with:
service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }}
credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }}
export_environment_variables: true
create_credentials_file: true
- name: Install Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@31ae3562f68c96d481c31bc1a8a55cc1be162f83
- name: Build the extender-client.jar
run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} client:jar
- name: Test the extender-client.jar
run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} client:test
- name: Publish to Google artifact registry
run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} publishExtenderClientPublicationToExtenderRepoRepository
- name: Prepare jar for GH release
run: |
mkdir -p ${{ github.workspace }}/gh_release
cp ${{ github.workspace }}/client/build/libs/extender-client-${{ steps.version.outputs.tag_version }}.jar \
${{ github.workspace }}/gh_release/extender-client-${{ steps.version.outputs.tag_version }}.jar
- name: Publish to Github release
run: |
chmod 0444 ${{ github.workspace }}/gh_release/*.jar
echo ${{ github.token }} | gh auth login --with-token
gh release create "${GITHUB_REF_NAME}" \
--draft \
--generate-notes \
--target ${{ github.sha }} \
${{ github.workspace }}/gh_release/*.jar
- name: Notify if tests failed
uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96
if: failure()
with:
type: ${{ job.status }}
job_name: 'Extender cleint release'
channel: '#defold-alarms-build'
url: ${{ secrets.SLACK_WEBHOOK }}
manifestmerger:
if: ${{ startsWith(github.ref_name, 'manifestmergetool-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Generate version
id: version
run: |
SHORT_SHA="$(echo ${GITHUB_SHA} | cut -c1-8)"
TAG_NAME=${{ github.ref_name }}
TAG_VERSION="${TAG_NAME#*-v}"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Login to Google Artifact registry (Maven)
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa
with:
service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }}
credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }}
export_environment_variables: true
create_credentials_file: true
- name: Install Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@31ae3562f68c96d481c31bc1a8a55cc1be162f83
- name: Build manifestmerger
run: ./gradlew -PmanifestMergetoolVersion=${{ steps.version.outputs.tag_version }} :manifestmergetool:mainJar
- name: Test manifestmerger
run: ./gradlew -PmanifestMergetoolVersion=${{ steps.version.outputs.tag_version }} :manifestmergetool:test
- name: Publish to Google artifact registry
run: ./gradlew -PmanifestMergetoolVersion=${{ steps.version.outputs.tag_version }} publishManifestMergeToolPublicationToExtenderRepoRepository
- name: Prepare jar for GH release
run: |
mkdir -p ${{ github.workspace }}/gh_release
cp ${{ github.workspace }}/server/manifestmergetool/build/libs/manifestmergetool-${{ steps.version.outputs.tag_version }}.jar \
${{ github.workspace }}/gh_release/manifestmergetool-${{ steps.version.outputs.tag_version }}.jar
- name: Publish to Github release
run: |
chmod 0444 ${{ github.workspace }}/gh_release/*.jar
echo ${{ github.token }} | gh auth login --with-token
gh release create "${GITHUB_REF_NAME}" \
--draft \
--generate-notes \
--target ${{ github.sha }} \
${{ github.workspace }}/gh_release/*.jar
- name: Notify if tests failed
uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96
if: failure()
with:
type: ${{ job.status }}
job_name: 'Manifest merge tool release'
channel: '#defold-alarms-build'
url: ${{ secrets.SLACK_WEBHOOK }}
extender:
if: ${{ startsWith(github.ref_name, 'extender-') }}
runs-on: ubuntu-latest
steps:
# cleanup disk space because we use lots of disk space for Docker image during extender tests
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Generate version
id: version
run: |
SHORT_SHA="$(echo ${GITHUB_SHA} | cut -c1-8)"
TAG_NAME=${{ github.ref_name }}
TAG_VERSION="${TAG_NAME#*-v}"
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Install Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@31ae3562f68c96d481c31bc1a8a55cc1be162f83
- name: Build extender
run: ./gradlew -PextenderVersion=${{ steps.version.outputs.tag_version }} server:bootJar
- name: Login to Google Artifact registry (Docker)
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: ${{ env.GOOGLE_ARTIFACT_REGISTRY }}
username: _json_key
password: ${{ secrets.DOCKER_REGISTRY_JSON_KEY }}
- name: Pull necessary docker images
run: |
# pull all containers under profile 'test'. Part of them is used in 'auth-test'
# if you need some new container under other profiles - need to add new statement with different profile
docker compose --file ./server/docker/docker-compose.yml --profile test pull
- name: Run extender tests
run: ./gradlew -PextenderVersion=${{ steps.version.outputs.tag_version }} server:test -i
- name: Login to Google Artifact registry (Maven)
uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa
with:
service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }}
credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }}
export_environment_variables: true
create_credentials_file: true
- name: Publish to Google artifact registry
run: ./gradlew -PextenderVersion=${{ steps.version.outputs.tag_version }} publishExtenderPublicationToExtenderRepoRepository
- name: Prepare jar for GH release
run: |
mkdir -p ${{ github.workspace }}/gh_release
cp ${{ github.workspace }}/server/build/libs/extender-${{ steps.version.outputs.tag_version }}.jar \
${{ github.workspace }}/gh_release/extender-${{ steps.version.outputs.tag_version }}.jar
- name: Publish to Github release
run: |
chmod 0444 ${{ github.workspace }}/gh_release/*.jar
echo ${{ github.token }} | gh auth login --with-token
gh release create "${GITHUB_REF_NAME}" \
--draft \
--generate-notes \
--target ${{ github.sha }} \
${{ github.workspace }}/gh_release/*.jar
- name: Notify if tests failed
uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96
if: failure()
with:
type: ${{ job.status }}
job_name: 'Extender release'
channel: '#defold-alarms-build'
url: ${{ secrets.SLACK_WEBHOOK }}