From 60db2f1bf0b54ea849348ded5e8d57b71974248f Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 17:20:31 -0600 Subject: [PATCH 01/12] Added update html step --- .github/workflows/chm.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 2255c4d8f..27facd495 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -34,6 +34,16 @@ jobs: working-directory: ${{ github.workspace }}/HTMLversion/HTML run: ./fixup_html.bash + - name: 'update html' + shell: bash + working-directory: ${{ github.workspace }}/HTMLversion/HTML + run: tar czf ../HTML.tar.gz HTML/*.htm HTML/*.png HTML/*.css + + - uses: actions/upload-artifact@v4 + with: + name: HTML + path: ${{github.workspace}}/HTMLversion/HTML.tar.gz + - name: cache htmlhelp id: cache-htmlhelp uses: actions/cache@v4 From ae1b27a68baf1e156582ded7b8a3348e29deef2c Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 17:27:21 -0600 Subject: [PATCH 02/12] Fixed working-directory --- .github/workflows/chm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 27facd495..c7e2b8dab 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -36,7 +36,7 @@ jobs: - name: 'update html' shell: bash - working-directory: ${{ github.workspace }}/HTMLversion/HTML + working-directory: ${{ github.workspace }}/HTMLversion run: tar czf ../HTML.tar.gz HTML/*.htm HTML/*.png HTML/*.css - uses: actions/upload-artifact@v4 From 065e09363859b81cc7ce9d167f2592587654ef38 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 17:29:52 -0600 Subject: [PATCH 03/12] Fixed HTML path --- .github/workflows/chm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index c7e2b8dab..5bf09d561 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: HTML - path: ${{github.workspace}}/HTMLversion/HTML.tar.gz + path: ${{github.workspace}}/HTML.tar.gz - name: cache htmlhelp id: cache-htmlhelp From 478c03c729fbf3b1ab5fd0d3cfca3316cc37abdb Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 17:44:27 -0600 Subject: [PATCH 04/12] Added parameters --- .github/workflows/chm.yml | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 5bf09d561..c6b223f2f 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -20,8 +20,91 @@ on: schedule: - cron: '1 2 2/7 * *' workflow_dispatch: + inputs: + date: + description: 'DATE: Leave blank to use todays date' + required: false + default: '' + + rel: + description: 'REL: Leave blank to automatically generate (2021-03-09 = 15700)' + required: false + default: '' + + ver: + description: 'VER: Leave blank to use MAJOR.MINOR.(PATCH+1) (from https://github.com/usgs-coupled/phreeqc-version/blob/main/phreeqc-version.txt)' + required: false + default: '' jobs: + + log-the-inputs: + runs-on: ubuntu-latest + steps: + - run: | + echo "Date: $DATE" + echo "REL: $REL" + echo "VER: $VER" + env: + DATE: ${{ inputs.date }} + REL: ${{ inputs.rel }} + VER: ${{ inputs.ver }} + + init: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + env: + DATE: ${{ inputs.date }} + REL: ${{ inputs.rel }} + VER: ${{ inputs.ver }} + # Map step outputs to job outputs + outputs: + VER: ${{ steps.vars.outputs.VER }} + REL: ${{ steps.vars.outputs.REL }} + DATE: ${{ steps.vars.outputs.DATE }} + DATE_FULL: ${{ steps.vars.outputs.DATE_FULL }} + DATE_RFC_3339: ${{ steps.vars.outputs.DATE_RFC_3339 }} + steps: + - name: Setup vars + id: vars + run: | + if [ -z "${VER}" ]; then + echo VER="$(curl -sS https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/next_ver.sh | sh)" >> "${GITHUB_OUTPUT}" + else + echo VER="${VER}" >> "${GITHUB_OUTPUT}" + fi + + if [ -z "${REL}" ]; then + echo REL="$(curl -sS https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/rel.py | python3)" >> "${GITHUB_OUTPUT}" + else + echo REL="${REL}" >> "${GITHUB_OUTPUT}" + fi + + if [ -z "${DATE}" ]; then + echo DATE="$(TZ='America/Denver' date '+%x')" >> "${GITHUB_OUTPUT}" + echo DATE_RFC_3339="$(TZ='America/Denver' date --rfc-3339=date)" >> "${GITHUB_OUTPUT}" + echo DATE_FULL="$(TZ='America/Denver' date)" >> "${GITHUB_OUTPUT}" + else + echo DATE="${DATE}" >> "${GITHUB_OUTPUT}" + echo DATE_RFC_3339="$(TZ='America/Denver' date --rfc-3339=date --date=${DATE})" >> "${GITHUB_OUTPUT}" + echo DATE_FULL="$(TZ='America/Denver' date --date=${DATE})" >> "${GITHUB_OUTPUT}" + fi + + results: + name: display results + needs: init + runs-on: ubuntu-latest + steps: + - name: results + run: | + echo VER="${{ needs.init.outputs.VER }}" + echo REL="${{ needs.init.outputs.REL }}" + echo DATE="${{ needs.init.outputs.DATE }}" + echo DATE_RFC_3339="${{ needs.init.outputs.DATE_RFC_3339 }}" + echo DATE_FULL="${{ needs.init.outputs.DATE_FULL }}" + # echo TARBALL="${{ needs.init.outputs.NAME_LOWERCASE }}-${{ needs.init.outputs.VER }}-${{ needs.init.outputs.REL }}.tar.gz" + echo TARBALL="phreeqcrm-${{ needs.init.outputs.VER }}-${{ needs.init.outputs.REL }}.tar.gz" + build-chm: runs-on: windows-latest steps: From de6a9c7f8fa84c32d7a6af708bb90a085c4dadb0 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Mon, 15 Apr 2024 17:47:38 -0600 Subject: [PATCH 05/12] Updated tarball name --- .github/workflows/chm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index c6b223f2f..62a9db697 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -102,8 +102,7 @@ jobs: echo DATE="${{ needs.init.outputs.DATE }}" echo DATE_RFC_3339="${{ needs.init.outputs.DATE_RFC_3339 }}" echo DATE_FULL="${{ needs.init.outputs.DATE_FULL }}" - # echo TARBALL="${{ needs.init.outputs.NAME_LOWERCASE }}-${{ needs.init.outputs.VER }}-${{ needs.init.outputs.REL }}.tar.gz" - echo TARBALL="phreeqcrm-${{ needs.init.outputs.VER }}-${{ needs.init.outputs.REL }}.tar.gz" + echo TARBALL="phreeqc-${{ needs.init.outputs.VER }}-${{ needs.init.outputs.REL }}.tar.gz" build-chm: runs-on: windows-latest From a861d329cde3873c6f4a7773f59656fd983344bf Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 10:25:40 -0600 Subject: [PATCH 06/12] Added distcheck --- .github/workflows/chm.yml | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 62a9db697..f85bb89d4 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -175,3 +175,57 @@ jobs: with: name: chm path: ${{github.workspace}}/HTMLversion/phreeqc3.chm + + distcheck: + # if: ${{ false }} + name: make distcheck + needs: init + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: chm + path: ${{github.workspace}}/HTMLversion/phreeqc3.chm + + - name: versioning + run: ./jenkins-phreeqc-dist.sh -v ${{ needs.init.outputs.VER }} -r ${{ needs.init.outputs.REL }} -d ${{ needs.init.outputs.DATE }} + + - name: bootstrap + run: ./bootstrap + + - name: mkdir + run: mkdir ${{github.workspace}}/_build + + - name: configure + working-directory: ${{github.workspace}}/_build + run: ../configure --prefix=$(pwd)/INSTALL + + - name: make distcheck + working-directory: ${{github.workspace}}/_build + run: DISTCHECK_CONFIGURE_FLAGS="" make -j2 distcheck + + - name: copy README + run: cp doc/README PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt + + - name: convert line endings + run: unix2dos doc/RELEASE doc/README + + - name: copy RELEASE + run: cp doc/RELEASE Phreeqc_ReleaseNotes.txt + + - name: make dist-zip + working-directory: ${{github.workspace}}/_build + run: make dist-zip + + - uses: actions/upload-artifact@v4 + with: + name: tarball + path: | + **/_build/*.tar.gz + **/_build/*.zip + **/PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt + **/Phreeqc_ReleaseNotes.txt + **/HTML.tar.gz From 611c2277500ec898874f43ff52a1b98c9ce2cf9a Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 10:34:57 -0600 Subject: [PATCH 07/12] Updated needs for distcheck --- .github/workflows/chm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index f85bb89d4..bb661a0f7 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -179,7 +179,7 @@ jobs: distcheck: # if: ${{ false }} name: make distcheck - needs: init + needs: [init, build-chm] runs-on: ubuntu-latest steps: From a114d7349a032ebce5ea4fbe4121730d17c49ab1 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 10:44:04 -0600 Subject: [PATCH 08/12] Updated path for download-artifact --- .github/workflows/chm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index bb661a0f7..38f914dd7 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -188,7 +188,7 @@ jobs: - uses: actions/download-artifact@v4 with: name: chm - path: ${{github.workspace}}/HTMLversion/phreeqc3.chm + path: ${{github.workspace}}/HTMLversion - name: versioning run: ./jenkins-phreeqc-dist.sh -v ${{ needs.init.outputs.VER }} -r ${{ needs.init.outputs.REL }} -d ${{ needs.init.outputs.DATE }} From 4befedd15253a436c845ae35788669d85426bd1b Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 10:57:34 -0600 Subject: [PATCH 09/12] Added install dos2unix step --- .github/workflows/chm.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 38f914dd7..373c64a53 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -190,6 +190,9 @@ jobs: name: chm path: ${{github.workspace}}/HTMLversion + - name: install dos2unix + run: sudo apt-get -y install dos2unix + - name: versioning run: ./jenkins-phreeqc-dist.sh -v ${{ needs.init.outputs.VER }} -r ${{ needs.init.outputs.REL }} -d ${{ needs.init.outputs.DATE }} From c6fcd1efccf692b2e4e88c6039cc5373d8c64feb Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 11:25:41 -0600 Subject: [PATCH 10/12] Updated uploads --- .github/workflows/chm.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index 373c64a53..b219313ef 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -190,6 +190,10 @@ jobs: name: chm path: ${{github.workspace}}/HTMLversion + - uses: actions/download-artifact@v4 + with: + name: HTML + - name: install dos2unix run: sudo apt-get -y install dos2unix @@ -227,8 +231,8 @@ jobs: with: name: tarball path: | - **/_build/*.tar.gz - **/_build/*.zip + **/*.tar.gz + **/*.zip **/PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt **/Phreeqc_ReleaseNotes.txt **/HTML.tar.gz From 9ba40ef1978af6b1efe34c5c1abb1895e5d9d3f4 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 12:18:54 -0600 Subject: [PATCH 11/12] Cleanup unneeded artifacts --- .github/workflows/chm.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/chm.yml b/.github/workflows/chm.yml index b219313ef..fad178981 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/chm.yml @@ -227,12 +227,22 @@ jobs: working-directory: ${{github.workspace}}/_build run: make dist-zip + - name: mv files + working-directory: ${{github.workspace}}/_build + run: mv *.tar.gz *.zip ../. + - uses: actions/upload-artifact@v4 with: name: tarball path: | - **/*.tar.gz - **/*.zip - **/PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt - **/Phreeqc_ReleaseNotes.txt - **/HTML.tar.gz + *.tar.gz + *.zip + PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt + Phreeqc_ReleaseNotes.txt + HTML.tar.gz + + - uses: geekyeggo/delete-artifact@v5 + with: + name: | + chm + HTML From 74cad02be825e7b6a8d06e231516716fcfdae999 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Tue, 16 Apr 2024 12:41:43 -0600 Subject: [PATCH 12/12] Minor cleanup --- .github/workflows/{chm.yml => dist.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{chm.yml => dist.yml} (98%) diff --git a/.github/workflows/chm.yml b/.github/workflows/dist.yml similarity index 98% rename from .github/workflows/chm.yml rename to .github/workflows/dist.yml index fad178981..516496bbe 100644 --- a/.github/workflows/chm.yml +++ b/.github/workflows/dist.yml @@ -1,4 +1,4 @@ -name: chm +name: dist on: push: @@ -233,10 +233,10 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: tarball + name: phreeqc-artifacts path: | - *.tar.gz - *.zip + phreeqc-*.tar.gz + phreeqc-*.zip PHREEQC_ReadMe_Windows_and_Linux_Batch_Versions.txt Phreeqc_ReleaseNotes.txt HTML.tar.gz