Skip to content

Commit

Permalink
Update release_with_jars.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored Sep 8, 2024
1 parent 65834a2 commit ab2df05
Showing 1 changed file with 14 additions and 38 deletions.
52 changes: 14 additions & 38 deletions .github/workflows/release_with_jars.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
name: Create release (draft)
# Workflow is triggered when any pom-file is updated in master-branch
# If both pom-files have the same version number it
# - builds NeqSim-jars both in Java 8 and Java 11
# - creates a new release and uploads the jars as artifacts
# - makes a new branch in neqsimpython and updates the jar-files used there.

on:
workflow_dispatch:
Expand Down Expand Up @@ -63,7 +58,7 @@ jobs:
run: mkdir staging && cp target/neqsim*Java8.jar staging
- uses: actions/upload-artifact@v3
with:
name: jarfiles
name: jarfiles-java8
path: staging

compile_java_11:
Expand All @@ -88,7 +83,7 @@ jobs:
run: mkdir staging && cp target/neqsim*.jar staging
- uses: actions/upload-artifact@v3
with:
name: jarfiles
name: jarfiles-java11
path: staging

compile_java_21:
Expand All @@ -115,19 +110,27 @@ jobs:
run: mkdir staging && cp target/neqsim*Java21.jar staging
- uses: actions/upload-artifact@v3
with:
name: jarfiles
name: jarfiles-java21
path: staging

create_release:
name: Create release v${{ needs.get_versions.outputs.version_8 }}
runs-on: ubuntu-latest
needs: [get_versions, compile_java_8, compile_java_11]
needs: [get_versions, compile_java_8, compile_java_11, compile_java_21]

steps:
- name: Download jar files from artifacts
- name: Download java 8 jar files
uses: actions/[email protected]
with:
name: jarfiles
name: jarfiles-java8
- name: Download java 11 jar files
uses: actions/[email protected]
with:
name: jarfiles-java11
- name: Download java 21 jar files
uses: actions/[email protected]
with:
name: jarfiles-java21

- name: Create release v${{ needs.get_versions.outputs.version_8 }}
uses: ncipollo/[email protected]
Expand All @@ -137,32 +140,5 @@ jobs:
draft: true
generateReleaseNotes: true
skipIfReleaseExists: true
artifactErrorsFailBuild: true
artifacts: "*.jar"
artifactContentType: application/java-archive

# # Needs to delete the old jars manually
# - run: mkdir lib && cp *.jar lib/
# - run: cd lib && mkdir libj8 && mv *Java8.jar libj8/ && cd ..

# - name: Create release branch in neqsimpython repo
# uses: GuillaumeFalourd/[email protected]
# with:
# repository_owner: Equinor
# repository_name: neqsimpython
# new_branch_name: NeqSim-jars-updated-${{ needs.get_versions.outputs.version_8 }}
# ssh_deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}

# - name: Push directory to another repository
# uses: cpina/[email protected]
# env:
# SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
# with:
# source-directory: 'lib'
# destination-github-username: 'equinor'
# destination-repository-name: 'neqsimpython'
# user-email: [email protected]
# target-branch: NeqSim-jars-updated-${{ needs.get_versions.outputs.version_8 }}
# target-directory: neqsim/lib
# commit_message: 'chore: updated jar-files'

0 comments on commit ab2df05

Please sign in to comment.