Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
another test on CI/CD...
Browse files Browse the repository at this point in the history
  • Loading branch information
celedev97 committed Nov 15, 2023
1 parent d34ad82 commit 56dcbc9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Build JAR Artifact

#on push to master or tag
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
push:
branches:
- master
tags:
- 'v*'

jobs:
build:
Expand All @@ -20,6 +23,11 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven

# if tag is present adjust pom version
- if: startsWith(github.ref, 'refs/tags/v')
name: Correct pom version as per tag name
run: mvn -B versions:set -DnewVersion="${{ github.ref_name }}" -DgenerateBackupPoms=false

- name: Configure application-prod.properties
run: |
Expand All @@ -33,5 +41,5 @@ jobs:
- name: Upload JAR Artifact
uses: actions/upload-artifact@v3
with:
name: asa_sm_snapshot
path: target/*.jar
name: asa_sm_jar
path: target/asa_sm.jar
36 changes: 13 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
name: Release installer
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_run:
workflows: ["Build JAR Artifact"]
branches: [master]
types:
- completed

permissions:
contents: write

jobs:
build:
release:
if: $github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'refs/tags/v')
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Correct pom version as per tag name
run: mvn -B versions:set -DnewVersion=${{ github.ref_name }} -DgenerateBackupPoms=false

- name: Configure application-prod.properties
run: |
python -c "import os; file = open('src/main/resources/application-prod.properties', 'w'); file.write(os.environ['APPLICATION_PROD_PROPERTIES']); file.close()"
env:
APPLICATION_PROD_PROPERTIES : ${{secrets.APPLICATION_PROD_PROPERTIES}}

- name: Build with Maven
run: mvn -B package --file pom.xml -Pprod
# download artifact asa_sm_jar
- uses: actions/download-artifact@v3
with:
name: asa_sm_jar
path: target

- name: Building the installer
run: |
Expand Down

0 comments on commit 56dcbc9

Please sign in to comment.