Skip to content

Commit

Permalink
#130: fixed release.yaml with same rules of maven.yaml (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored Feb 26, 2023
1 parent b2cac71 commit d049289
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

Expand Down
136 changes: 114 additions & 22 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build_release:
build_maven_net6:
# The type of runner that the job will run on
runs-on: windows-2022

Expand All @@ -23,37 +23,20 @@ jobs:
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
submodules: 'true'

# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\JCOReflectorCLI.sln

- uses: nuget/[email protected]
with:
nuget-version: '5.x'

- run: nuget pack src\CLI\JCOReflectorCLI.nuspec -OutputDirectory .\bin
run: dotnet build --no-incremental --framework net6.0 --configuration Release /p:Platform="Any CPU" src\JCOReflectorCLI.sln

# Runs a set of commands using the runners shell
- name: Copy configuration file
run: |
Copy-Item .github\workflows\JCOReflectorCLI6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
Copy-Item .github\workflows\JCOReflectorCLI7.0.runtimeconfig.json -Destination bin\net7.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
run: Copy-Item .github\workflows\JCOReflectorCLI6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force

- name: Build net6.0 Maven POM files
run: dotnet bin\net6.0\MASES.JCOReflectorCLI.dll -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job

- name: Build net7.0 Maven POM files
run: dotnet bin\net7.0\MASES.JCOReflectorCLI.dll -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job

- name: Build net462 Maven POM files
run: .\bin\net462\MASES.JCOReflectorCLI -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
Expand All @@ -68,7 +51,7 @@ jobs:

- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file -Dfile=./bin/net6.0/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.3 -Dpackaging=jar -DgeneratePom=true
run: mvn install:install-file --no-transfer-progress -Dfile=../../bin/net6.0/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.3 -Dpackaging=jar -f ./netreflected/src/net6.0.xml

- name: Publish net6.0 to Apache Maven Central
shell: bash
Expand All @@ -78,6 +61,46 @@ jobs:
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

build_maven_net7:
# The type of runner that the job will run on
runs-on: windows-2022

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net7.0 --configuration Release /p:Platform="Any CPU" src\JCOReflectorCLI.sln

# Runs a set of commands using the runners shell
- name: Copy configuration file
run: Copy-Item .github\workflows\JCOReflectorCLI7.0.runtimeconfig.json -Destination bin\net7.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force

- name: Build net7.0 Maven POM files
run: dotnet bin\net7.0\MASES.JCOReflectorCLI.dll -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: temurin
java-version: 11
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file --no-transfer-progress -Dfile../../bin/net7.0/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.3 -Dpackaging=jar -f ./netreflected/src/net6.0.xml

- name: Publish net7.0 to Apache Maven Central
shell: bash
run: mvn --file ./netreflected/src/net7.0.xml --no-transfer-progress --batch-mode -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} deploy
Expand All @@ -86,6 +109,42 @@ jobs:
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

build_maven_net462:
# The type of runner that the job will run on
runs-on: windows-2022

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --framework net462 --configuration Release /p:Platform="Any CPU" src\JCOReflectorCLI.sln

- name: Build net462 Maven POM files
run: .\bin\net462\MASES.JCOReflectorCLI -JobType CreatePOM -POMStagingType Release -JobFile .github\workflows\createpom_win19.job

- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: temurin
java-version: 11
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file --no-transfer-progress -Dfile=../../bin/net462/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.3 -Dpackaging=jar -f ./netreflected/src/net462.xml

- name: Publish net462 to Apache Maven Central
shell: bash
run: mvn --file ./netreflected/src/net462.xml --no-transfer-progress --batch-mode -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} deploy
Expand All @@ -94,6 +153,39 @@ jobs:
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

build_release:
needs: [build_maven_net6, build_maven_net7, build_maven_net462]
# The type of runner that the job will run on
runs-on: windows-2022

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
# Support longpaths
- name: Support long paths
run: git config --system core.longpaths true

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
submodules: 'true'

# Runs a set of commands using the runners shell
- name: Build JCOReflectorCLI
run: dotnet build --no-incremental --configuration Release /p:Platform="Any CPU" src\JCOReflectorCLI.sln

- uses: nuget/[email protected]
with:
nuget-version: '5.x'

- run: nuget pack src\CLI\JCOReflectorCLI.nuspec -OutputDirectory .\bin

# Runs a set of commands using the runners shell
- name: Copy configuration file
run: |
Copy-Item .github\workflows\JCOReflectorCLI6.0.runtimeconfig.json -Destination bin\net6.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
Copy-Item .github\workflows\JCOReflectorCLI7.0.runtimeconfig.json -Destination bin\net7.0\MASES.JCOReflectorCLI.runtimeconfig.json -Force
- name: Build Java files

run: |
Expand Down

0 comments on commit d049289

Please sign in to comment.