From 4e8af0d9d9259d14b796ffa0c2a8b9ec76b43aef Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 28 Apr 2022 11:07:02 +0100 Subject: [PATCH 1/3] add workflow to release artifacts to github --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 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..94001b7a0c8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +--- +name: Build and publish packages + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Install slice2java + run: | + sudo apt-get install -y libmcpp-dev + wget -q https://github.com/ome/zeroc-ice-ubuntu2004/releases/download/0.2.0/ice-3.6.5-0.2.0-ubuntu2004-amd64.tar.gz + tar xf ice-3.6.5-0.2.0-ubuntu2004-amd64.tar.gz + mv ice-3.6.5-0.2.0 ice-3.6.5 + mv ice-3.6.5 /opt + rm ice-3.6.5-0.2.0-ubuntu2004-amd64.tar.gz + echo "/opt/ice-3.6.5/bin" >> $GITHUB_PATH + - name: Build artifacts + run: ./build.py build-dev release-all + - name: Upload Release Assets + run: | + set -x + assets=() + touch SHASUMS + touch MD5 + for asset in ./target/*.zip; do + assets+=("-a" "$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+=("-a" SHASUMS) + assets+=("-a" MD5) + tag_name="${GITHUB_REF##*/}" + hub release create "${assets[@]}" -m "$tag_name" "$tag_name" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d9eb185d09e7248d79dce2214485e7feb0f60659 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 28 Apr 2022 11:18:20 +0100 Subject: [PATCH 2/3] set version --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94001b7a0c8..313343966ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,12 @@ jobs: mv ice-3.6.5 /opt rm ice-3.6.5-0.2.0-ubuntu2004-amd64.tar.gz echo "/opt/ice-3.6.5/bin" >> $GITHUB_PATH + - name: Set version + run: | + tag_name="${GITHUB_REF##*/}" + tag_value="${tag_name:1}" + echo tag_value + echo "omero.version=$tag_value" >> etc/local.properties - name: Build artifacts run: ./build.py build-dev release-all - name: Upload Release Assets From f913ea5e7888c4ac7277fbaee2125d40620cca5b Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Thu, 28 Apr 2022 11:22:42 +0100 Subject: [PATCH 3/3] remove echo --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 313343966ab..dd6af1ef096 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,6 @@ jobs: run: | tag_name="${GITHUB_REF##*/}" tag_value="${tag_name:1}" - echo tag_value echo "omero.version=$tag_value" >> etc/local.properties - name: Build artifacts run: ./build.py build-dev release-all