-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to build/release gradle templates * Bump template version to v2.1.2
- Loading branch information
1 parent
dd56f65
commit d763f49
Showing
2 changed files
with
21 additions
and
46 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Gradle Compile & UT | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
run-build-and-deploy: | ||
uses: octopusden/octopus-base/.github/workflows/[email protected] | ||
with: | ||
flow-type: hybrid | ||
java-version: '11' | ||
docker-image: employee-service |
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 |
---|---|---|
@@ -1,52 +1,16 @@ | ||
name: Release | ||
name: Gradle Release | ||
|
||
on: | ||
repository_dispatch: | ||
types: [ release ] | ||
types: release | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: Prod | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: Checkout(switching to commit) | ||
with: | ||
ref: ${{ github.event.client_payload.commit }} | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: GitHub Tag Name | ||
run: | | ||
echo "Current version: ${{ github.event.client_payload.project_version }}" | ||
- name: Build with Gradle | ||
run: ./gradlew build dockerBuildImage -x test -Poctopus.github.docker.registry=ghcr.io -Pdocker.registry=docker.io -Pversion=${{ github.event.client_payload.project_version }} --info | ||
env: | ||
BUILD_VERSION: ${{ github.event.client_payload.project_version }} | ||
- name: Publish | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ github.event.client_payload.project_version }} | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} | ||
BUILD_VERSION: ${{ github.event.client_payload.project_version }} | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push to docker registry | ||
run: docker push ghcr.io/octopusden/employee-service:${{ github.event.client_payload.project_version }} | ||
- name: Create Release | ||
uses: marvinpinto/action-automatic-releases@master | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
automatic_release_tag: v${{ github.event.client_payload.project_version }} | ||
uses: octopusden/octopus-base/.github/workflows/[email protected] | ||
with: | ||
flow-type: hybrid | ||
java-version: '11' | ||
commit-hash: ${{ github.event.client_payload.commit }} | ||
build-version: ${{ github.event.client_payload.project_version }} | ||
docker-image: employee-service | ||
secrets: inherit |