-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #521 from MD-Anderson-Bioinformatics/buildargs
This pull request merge addresses two main concerns: 1. Send git info to docker build via build arguments 2. Add action to create NG-CHM-Artifacts release - This addresses issue #514 I also refactored other action workflows for clarity.
- Loading branch information
Showing
9 changed files
with
194 additions
and
73 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
## | ||
## GitHub Workflow of 2 sequential jobs: | ||
## Create build tag, build artifacts and push to NG-CHM-Artifacts triggered by push to main | ||
## | ||
## 1. make_build_tag | ||
## This workflow has two sequential jobs: | ||
## | ||
## 1. make_build_tag | ||
## | ||
## Adds a incremental build tag to the repo based on: | ||
## | ||
|
@@ -17,7 +19,7 @@ | |
## and the version from CompatibilityManager.js is '2.22.1', the new tag | ||
## will be: 2.22.1-build-5. | ||
## | ||
## 2. build_artifacts | ||
## 2. build_artifacts | ||
## | ||
## Builds all artifacts from Dockerfile and checks them into the 'NG-CHM-Artifacts' | ||
## repo with the same tag as the build tag from the first job. | ||
|
@@ -33,6 +35,9 @@ | |
## - WebContent/server.app (directory) | ||
## | ||
|
||
name: NG-CHM-Artifacts tag | ||
## concurrency group prevents race condition with NG-CHM-Artifacts_release.yml | ||
concurrency: artifacts | ||
on: | ||
push: | ||
branches: | ||
|
@@ -42,12 +47,11 @@ on: | |
jobs: | ||
make_build_tag: | ||
runs-on: ubuntu-22.04 | ||
name: Creating Build Number Tag | ||
name: Tag w/ build number | ||
strategy: | ||
max-parallel: 1 | ||
steps: | ||
# https://github.com/marketplace/actions/checkout | ||
- name: Checkout | ||
- name: Checkout commit | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} | ||
|
@@ -61,7 +65,7 @@ jobs: | |
start_string: 'CM.version = ' | ||
# https://github.com/marohrdanz/build-number-tag | ||
# Output from this step is tag name as 'build_number'. | ||
- name: Create Build Number Tag | ||
- name: Create build tag | ||
id: make_tag | ||
uses: marohrdanz/[email protected] | ||
with: | ||
|
@@ -73,16 +77,20 @@ jobs: | |
tag_name: ${{ steps.make_tag.outputs.tag_name }} | ||
build_artifacts: | ||
runs-on: ubuntu-latest | ||
name: Build Artifacts | ||
name: NG-CHM-Artifacts tag | ||
needs: make_build_tag | ||
strategy: | ||
max-parallel: 1 | ||
env: | ||
Artifacts_REPOSITORY: "MD-Anderson-Bioinformatics/NG-CHM-Artifacts" | ||
Artifacts_REPOSITORY: "${{ github.repository_owner }}/NG-CHM-Artifacts" | ||
Artifacts_BRANCH: "main" | ||
JAVA_VERSION: 11 | ||
steps: | ||
- name: Checkout Tag Created In "Creating Build Number Tag" Job | ||
- name: Make git info available for ant build | ||
run: | | ||
echo "GIT_COMMIT=`echo ${{ github.sha }} | cut -c1-7`" >> $GITHUB_ENV | ||
echo "GIT_LATEST_TAG=${{ needs.make_build_tag.outputs.tag_name }}" >> $GITHUB_ENV | ||
- name: Checkout build tag | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.make_build_tag.outputs.tag_name }} | ||
|
@@ -107,14 +115,14 @@ jobs: | |
run: | | ||
cd NGCHM | ||
ant -f build_ngchmApp.xml | ||
- name: Check out Artifacts repo | ||
- name: Check out NG-CHM-Artifacts repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.Artifacts_REPOSITORY }} | ||
token: ${{ secrets.DQS_DEV_BCB_ACTIONS_TOKEN }} | ||
ref: ${{ env.Artifacts_BRANCH }} | ||
path: "./Artifacts" | ||
- name: Copy artifacts | ||
- name: Copy artifacts to NG-CHM-Artifacts | ||
run: | | ||
cd Artifacts | ||
cp ../NGCHM/ShaidyMapGen.jar shaidymapgen/ | ||
|
@@ -132,7 +140,7 @@ jobs: | |
cp -r ../NGCHM/WebContent/ viewer.source/ | ||
echo "Build tag: ${{ needs.make_build_tag.outputs.tag_name }}" > viewer.source/WebContent/build_version.txt | ||
echo "Git hash: ${{ github.sha }}" >> viewer.source/WebContent/build_version.txt | ||
- name: Commit, tag, and push to Artifacts repo | ||
- name: Commit, tag, and push to NG-CHM-Artifacts repo | ||
run: | | ||
cd Artifacts | ||
git config --local user.email "[email protected]" | ||
|
@@ -142,4 +150,5 @@ jobs: | |
git push origin ${{ env.Artifacts_BRANCH }} | ||
git tag ${{ needs.make_build_tag.outputs.tag_name }} | ||
git push origin ${{ needs.make_build_tag.outputs.tag_name }} | ||
echo "::notice::Created tag ${{ needs.make_build_tag.outputs.tag_name }} in ${{ env.Artifacts_REPOSITORY }}" | ||
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,119 @@ | ||
## | ||
## Build artifacts for NG-CHM-Artifacts triggered by release | ||
## | ||
## Builds all artifacts from Dockerfile, checks them into the 'NG-CHM-Artifacts', | ||
## and creates corresponding release. | ||
## | ||
## Artifacts built: | ||
## | ||
## - ShaidyMapGen.jar | ||
## - GalaxyMapGen.jar | ||
## - GUIBuilderMapGen.jar | ||
## - ngchmWidget-min.js | ||
## - ngchmEmbed-min.js | ||
## - WebContent/ngChmApp.html | ||
## - WebContent/server.app (directory) | ||
## | ||
|
||
name: NG-CHM-Artifacts release | ||
## concurrency group prevents race condition with NG-CHM-Artifacts_push_main.yml | ||
concurrency: artifacts | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_artifacts: | ||
runs-on: ubuntu-latest | ||
name: NG-CHM-Artifacts release | ||
strategy: | ||
max-parallel: 1 | ||
env: | ||
Artifacts_REPOSITORY: "${{ github.repository_owner }}/NG-CHM-Artifacts" | ||
Artifacts_BRANCH: "main" | ||
JAVA_VERSION: 11 | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} | ||
- name: Make git info available for ant build | ||
run: | | ||
echo "GIT_COMMIT=`echo ${{ github.sha }} | cut -c1-7`" >> $GITHUB_ENV | ||
echo "GIT_LATEST_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | ||
# https://github.com/marohrdanz/extract-version-from-file | ||
# Output from this step is version from CompatibilityManager as 'version_number'. | ||
- name: Get version number | ||
id: get_version_number | ||
uses: marohrdanz/[email protected] | ||
with: | ||
file_path: 'NGCHM/WebContent/javascript/CompatibilityManager.js' | ||
start_string: 'CM.version = ' | ||
- name: Set up JDK for java ${{ env.JAVA_VERSION }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "${{ env.JAVA_VERSION }}" | ||
distribution: 'temurin' | ||
- name: Build ShaidyMapGen.jar | ||
run: | | ||
cd NGCHM | ||
ant -f build_shaidyRmapgen.xml | ||
- name: Build GalaxyMapGen.jar | ||
run: | | ||
cd NGCHM | ||
ant -f build_galaxymapgen.xml | ||
- name: Build GUIBuilderMapGen.jar | ||
run: | | ||
cd NGCHM | ||
ant -f build_guibuildermapgen.xml | ||
- name: Build NG-CHM standalone files and server.app | ||
run: | | ||
cd NGCHM | ||
ant -f build_ngchmApp.xml | ||
- name: Check out NG-CHM-Artifacts repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.Artifacts_REPOSITORY }} | ||
token: ${{ secrets.DQS_DEV_BCB_ACTIONS_TOKEN }} | ||
ref: ${{ env.Artifacts_BRANCH }} | ||
path: "./Artifacts" | ||
- name: Copy artifacts to NG-CHM-Artifacts | ||
run: | | ||
cd Artifacts | ||
cp ../NGCHM/ShaidyMapGen.jar shaidymapgen/ | ||
cp ../NGCHM/GalaxyMapGen.jar galaxymapgen/ | ||
cp ../NGCHM/GUIBuilderMapGen.jar guibuildermapgen/ | ||
cp ../NGCHM/ngchmWidget-min.js viewer.standalone/ | ||
cp ../NGCHM/ngchmEmbed-min.js viewer.standalone/ | ||
cp ../NGCHM/WebContent/ngChmApp.html viewer.standalone/ | ||
echo "Build tag: ${{ github.ref_name }}" > viewer.standalone/build_version.txt | ||
echo "Git hash: ${{ github.sha }}" >> viewer.standalone/build_version.txt | ||
cp -r ../NGCHM/WebContent/server.app viewer.build/ | ||
echo "Build tag: ${{ github.ref_name }}" > viewer.build/server.app/build_version.txt | ||
echo "Git hash: ${{ github.sha }}" >> viewer.build/server.app/build_version.txt | ||
rm -rf ../NGCHM/WebContent/server.app | ||
cp -r ../NGCHM/WebContent/ viewer.source/ | ||
echo "Build tag: ${{ github.ref_name }}" > viewer.source/WebContent/build_version.txt | ||
echo "Git hash: ${{ github.sha }}" >> viewer.source/WebContent/build_version.txt | ||
- name: Commit, tag, and push to NG-CHM-Artifacts repo | ||
run: | | ||
cd Artifacts | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
git add . | ||
git commit -m "Build from NG-CHM tag ${{ github.ref_name }}" | ||
git push origin ${{ env.Artifacts_BRANCH }} | ||
git tag ${{ github.ref_name }} | ||
git push origin ${{ github.ref_name }} | ||
- name: Create a release in NG-CHM-Artifacts repo | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.DQS_DEV_BCB_ACTIONS_TOKEN }} | ||
body: "Version ${{ steps.get_version_number.outputs.version_number }}" | ||
repository: ${{ env.Artifacts_REPOSITORY }} | ||
- name: Create notice of success | ||
run: | | ||
echo "::notice::Created release ${{ steps.get_version_number.outputs.version_number }} in ${{ env.Artifacts_REPOSITORY }}" | ||
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
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
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
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
Oops, something went wrong.