From bad45e4918f5cc11a19d50b5c5cc512ecc60a742 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 28 Jun 2022 16:18:09 +0100 Subject: [PATCH 01/12] add release job --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..6b0a19fe105 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: "Build and push artifacts" +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0' + +jobs: + build: + name: Release artifacts + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set version + if: startsWith(github.ref, 'refs/tags') + run: | + tag_name="${GITHUB_REF##*/}" + tag_value="${tag_name:1}-ice36" + echo "omero.version=$tag_value" >> etc/local.properties + - name: Build and package + run: ./build.py build-dev release-all + - name: Upload Release Assets + if: startsWith(github.ref, 'refs/tags') + run: | + set -x + assets=() + touch SHASUMS + touch MD5 + for asset in ./target/*.zip; do + assets+=("$asset") + filename=$(basename -- "$asset") + sha=$(sha256sum $asset) + IFS=' ' read -r -a array <<< "$sha" + echo "${array[0]} $filename" >> SHASUMS + md5=$(md5sum $asset) + IFS=' ' read -r -a array <<< "$md5" + echo "${array[0]} $filename" >> MD5 + done + assets+=(SHASUMS) + assets+=(MD5) + tag_name="${GITHUB_REF##*/}" + gh release create "$tag_name" "${assets[@]}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 0edad4674efb946c5382ac7efcdbfb73cd72bd9a Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 28 Jun 2022 16:29:22 +0100 Subject: [PATCH 02/12] run on tag only --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b0a19fe105..34903eb6f6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,8 @@ name: "Build and push artifacts" on: push: - pull_request: - schedule: - - cron: '0 0 * * 0' + tags: + - '*' jobs: build: From 7578da2b227cca0fe9adcb9ef7aca0868cd2ebf7 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 28 Jun 2022 17:16:51 +0100 Subject: [PATCH 03/12] add release source --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34903eb6f6a..ba44918eb49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: tag_value="${tag_name:1}-ice36" echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package - run: ./build.py build-dev release-all + run: ./build.py build-dev release-all release-src - name: Upload Release Assets if: startsWith(github.ref, 'refs/tags') run: | From 18161ff8aa95daba2e1384bd855db4bc78c88c06 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 28 Jun 2022 21:32:31 +0100 Subject: [PATCH 04/12] set properties --- build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index d5f3c9503b3..1c85d14eb90 100644 --- a/build.xml +++ b/build.xml @@ -259,7 +259,7 @@ To get started using Eclipse, execute "ant build-dev" and import the top-level - + @@ -269,7 +269,7 @@ To get started using Eclipse, execute "ant build-dev" and import the top-level - From cc76582ff26d28a7e9c1ba838b5b3436e85fbce0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 29 Jun 2022 21:14:48 +0100 Subject: [PATCH 05/12] remove md5 --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba44918eb49..55d32bc2917 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,19 +24,14 @@ jobs: set -x assets=() touch SHASUMS - touch MD5 for asset in ./target/*.zip; do assets+=("$asset") filename=$(basename -- "$asset") sha=$(sha256sum $asset) IFS=' ' read -r -a array <<< "$sha" echo "${array[0]} $filename" >> SHASUMS - md5=$(md5sum $asset) - IFS=' ' read -r -a array <<< "$md5" - echo "${array[0]} $filename" >> MD5 done assets+=(SHASUMS) - assets+=(MD5) tag_name="${GITHUB_REF##*/}" gh release create "$tag_name" "${assets[@]}" env: From 79990124338d0f358c9c7bd949463ee487888c68 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 29 Jun 2022 21:15:07 +0100 Subject: [PATCH 06/12] remove conditional --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55d32bc2917..24d62c77162 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set version - if: startsWith(github.ref, 'refs/tags') run: | tag_name="${GITHUB_REF##*/}" tag_value="${tag_name:1}-ice36" From d9d20356bd853562bf5bf29a90a25838042be930 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 30 Jun 2022 09:09:03 +0100 Subject: [PATCH 07/12] remove remaining conditional --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24d62c77162..9053b8f406c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,13 @@ jobs: - uses: actions/checkout@v2 - name: Set version run: | + echo ${{github.job}} tag_name="${GITHUB_REF##*/}" tag_value="${tag_name:1}-ice36" echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package run: ./build.py build-dev release-all release-src - name: Upload Release Assets - if: startsWith(github.ref, 'refs/tags') run: | set -x assets=() From d0b40546edf8ab2d08fc6a8d4bdc50c370962beb Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 30 Jun 2022 09:24:11 +0100 Subject: [PATCH 08/12] add run_id to the name --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9053b8f406c..bce33a33d45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,8 @@ jobs: - uses: actions/checkout@v2 - name: Set version run: | - echo ${{github.job}} tag_name="${GITHUB_REF##*/}" - tag_value="${tag_name:1}-ice36" + tag_value="${tag_name:1}-ice36-b${{ github.run_id }}" echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package run: ./build.py build-dev release-all release-src From 96434838723692d63faadf8c46b100a53f7d5e06 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 6 Jul 2022 09:19:21 +0100 Subject: [PATCH 09/12] remove build number --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bce33a33d45..b8b983d5a02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Set version run: | tag_name="${GITHUB_REF##*/}" - tag_value="${tag_name:1}-ice36-b${{ github.run_id }}" + tag_value="${tag_name:1}-ice36" echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package run: ./build.py build-dev release-all release-src From 1969408242b88417ad4b4944ad7cbc73357006f4 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 6 Jul 2022 14:41:42 +0100 Subject: [PATCH 10/12] use wildcard --- .github/workflows/release.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8b983d5a02..ab4c3c55e1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,20 +17,11 @@ jobs: echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package run: ./build.py build-dev release-all release-src - - name: Upload Release Assets + - name: Create a release and upload Release Assets run: | - set -x - assets=() - touch SHASUMS - for asset in ./target/*.zip; do - assets+=("$asset") - filename=$(basename -- "$asset") - sha=$(sha256sum $asset) - IFS=' ' read -r -a array <<< "$sha" - echo "${array[0]} $filename" >> SHASUMS - done - assets+=(SHASUMS) + cd target tag_name="${GITHUB_REF##*/}" - gh release create "$tag_name" "${assets[@]}" + sha256sum ./*.zip >> SHASUMS + gh release create "$tag_name" ./*.zip SHASUMS env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From bb973e301de9958e745c26add64b5ab9793187ef Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Wed, 6 Jul 2022 14:51:34 +0100 Subject: [PATCH 11/12] add line --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab4c3c55e1e..020cc6cdb4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,4 +24,4 @@ jobs: sha256sum ./*.zip >> SHASUMS gh release create "$tag_name" ./*.zip SHASUMS env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2945cdf26f96baeedfd906f9eb2c5658560fd96e Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 12 Jul 2022 09:34:04 +0100 Subject: [PATCH 12/12] handle characters before number if any --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 020cc6cdb4a..4cfa958cccc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,8 @@ jobs: - name: Set version run: | tag_name="${GITHUB_REF##*/}" - tag_value="${tag_name:1}-ice36" + tag_name=$(grep -o '[0-9].*' <<< $tag_name) + tag_value="${tag_name}-ice36" echo "omero.version=$tag_value" >> etc/local.properties - name: Build and package run: ./build.py build-dev release-all release-src