You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2023/09/27 23:02:30 UTC
[GitHub] [netbeans] mbien commented on a diff in pull request #6496: Update profiler workflow for possible release process
mbien commented on code in PR #6496:
URL: https://github.com/apache/netbeans/pull/6496#discussion_r1339296430
##########
.github/workflows/native-binary-build-lib.profiler.yml:
##########
@@ -73,75 +72,112 @@ on:
jobs:
- build-linux:
+
+ source:
+
+ name: Build source zip
runs-on: ubuntu-latest
steps:
- # Step 1
- # Checkout source code from repository
- #
- - name: Checkout source code
- uses: actions/checkout@v2
- with:
- persist-credentials: false
- #
- # Step 2
- # Ant build NetBeans lib.profiler module. The sole reason for doing this - in the
- # context of the native binaries for the Profiler - is to have JNI header files
- # generated which are needed in step 3.
- #
- - name: Generate JNI header files
- run: |
- export JDK_HOME=${JAVA_HOME_8_X64}
- echo "Building NbBuild bootstrap (needed for next step)"
- ant bootstrap
- echo "Building lib.profiler module"
- cd profiler/lib.profiler && ant compile
- #
- # Step 3
- # Build the native binary from C source code
- #
- - name: Build native lib
- run: |
- export JDK_HOME=${JAVA_HOME_8_X64}
- #
- #
- echo "Building 64-bit binary"
- rm -f ../../release/lib/deployed/jdk16/linux-amd64/*.*
- bash -e -x ./buildnative-linux64.sh
- ls -l -R ../../release/lib/deployed/jdk16/linux-amd64
- #
- #
- echo "Building 32-bit binary"
- # Since we are on 64-bit system it means we do not by default have support
- # for creating 32-bit binaries, however this support comes if we install
- # the 'gcc-multilib' package for GNU C/C++.
- sudo apt-get update
- sudo apt-get install gcc-multilib
- rm -f ../../release/lib/deployed/jdk16/linux/*.*
- bash -e -x ./buildnative-linux.sh
- ls -l -R ../../release/lib/deployed/jdk16/linux
- #
- #
- echo "done"
- working-directory: profiler/lib.profiler/native/scripts
- #
- # Step 4
- # Upload interim build artifacts to GitHub
- #
- - name: Upload artifact Linux 64 bit
- uses: actions/upload-artifact@v2
- with:
- name: linux-amd64
- path: profiler/lib.profiler/release/lib/deployed/jdk16/linux-amd64/
- if-no-files-found: error
- - name: Upload artifact Linux 32 bit
- uses: actions/upload-artifact@v2
- with:
- name: linux
- path: profiler/lib.profiler/release/lib/deployed/jdk16/linux/
- if-no-files-found: error
+
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ submodules: false
+
+ - name: Caching dependencies
+ uses: actions/cache@v3
+ with:
+ path: ~/.hgexternalcache
+ key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }}
+ restore-keys: ${{ runner.os }}-
Review Comment:
recommending to use the (fairly new) restore action:
`uses: actions/cache/restore@v3 `
(rest can be kept the same)
I think it is better to have only one job with write access to the cache, makes results more predictable.
This reminds me to update that on the platform job too, since back then the restore action didn't exist.
##########
.github/workflows/native-binary-build-lib.profiler.yml:
##########
@@ -73,75 +72,112 @@ on:
jobs:
- build-linux:
+
+ source:
Review Comment:
recommend to add:
```
defaults:
run:
shell: bash
```
somewhere on top of the workflow. `bash` is supported by all runners. Powershell is scary. It took 1h10m to extract the build artifact on windows the last time i forgot to set the shell default.
##########
.github/workflows/native-binary-build-lib.profiler.yml:
##########
@@ -73,75 +72,112 @@ on:
jobs:
- build-linux:
+
+ source:
+
+ name: Build source zip
runs-on: ubuntu-latest
steps:
- # Step 1
- # Checkout source code from repository
- #
- - name: Checkout source code
- uses: actions/checkout@v2
- with:
- persist-credentials: false
- #
- # Step 2
- # Ant build NetBeans lib.profiler module. The sole reason for doing this - in the
- # context of the native binaries for the Profiler - is to have JNI header files
- # generated which are needed in step 3.
- #
- - name: Generate JNI header files
- run: |
- export JDK_HOME=${JAVA_HOME_8_X64}
- echo "Building NbBuild bootstrap (needed for next step)"
- ant bootstrap
- echo "Building lib.profiler module"
- cd profiler/lib.profiler && ant compile
- #
- # Step 3
- # Build the native binary from C source code
- #
- - name: Build native lib
- run: |
- export JDK_HOME=${JAVA_HOME_8_X64}
- #
- #
- echo "Building 64-bit binary"
- rm -f ../../release/lib/deployed/jdk16/linux-amd64/*.*
- bash -e -x ./buildnative-linux64.sh
- ls -l -R ../../release/lib/deployed/jdk16/linux-amd64
- #
- #
- echo "Building 32-bit binary"
- # Since we are on 64-bit system it means we do not by default have support
- # for creating 32-bit binaries, however this support comes if we install
- # the 'gcc-multilib' package for GNU C/C++.
- sudo apt-get update
- sudo apt-get install gcc-multilib
- rm -f ../../release/lib/deployed/jdk16/linux/*.*
- bash -e -x ./buildnative-linux.sh
- ls -l -R ../../release/lib/deployed/jdk16/linux
- #
- #
- echo "done"
- working-directory: profiler/lib.profiler/native/scripts
- #
- # Step 4
- # Upload interim build artifacts to GitHub
- #
- - name: Upload artifact Linux 64 bit
- uses: actions/upload-artifact@v2
- with:
- name: linux-amd64
- path: profiler/lib.profiler/release/lib/deployed/jdk16/linux-amd64/
- if-no-files-found: error
- - name: Upload artifact Linux 32 bit
- uses: actions/upload-artifact@v2
- with:
- name: linux
- path: profiler/lib.profiler/release/lib/deployed/jdk16/linux/
- if-no-files-found: error
+
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ submodules: false
+
+ - name: Caching dependencies
+ uses: actions/cache@v3
+ with:
+ path: ~/.hgexternalcache
+ key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }}
+ restore-keys: ${{ runner.os }}-
+
+ # Ant build NetBeans lib.profiler module. The sole reason for doing this - in the
+ # context of the native binaries for the Profiler - is to have JNI header files
+ - name: Generate JNI header files
+ run: |
+ export JDK_HOME=${JAVA_HOME_8_X64}
+ echo "Building NbBuild bootstrap (needed for next step)"
+ ant bootstrap
+ echo "Building lib.profiler module"
+ cd profiler/lib.profiler && ant compile
+
+ - name: Generate source bundle
+ run: |
+ SOURCES="profiler/lib.profiler/build/sources"
+ mkdir -p ${SOURCES}/profiler/lib.profiler
+ cp -r profiler/lib.profiler/native/ ${SOURCES}/profiler/lib.profiler/
+ find profiler/lib.profiler/release/lib/deployed -type d -exec mkdir -p "${SOURCES}/{}" \; -exec touch "${SOURCES}/{}/PLACEHOLDER" \;
+ cp LICENSE ${SOURCES}/LICENSE
+ cp NOTICE ${SOURCES}/NOTICE
+ ls -l -R ${SOURCES}
+ - name: Upload native sources
+ uses: actions/upload-artifact@v3
+ with:
+ name: profiler-external-sources-ASF
+ path: profiler/lib.profiler/build/sources/
+ if-no-files-found: error
Review Comment:
would the empty folder problem be solved by running tar before upload like the main workflow does?
supported by all runners if bash is used
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists