Skip to content

Commit

Permalink
update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Oct 15, 2024
1 parent fe35524 commit c25b2a9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 41 deletions.
63 changes: 23 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# https://github.com/FNNDSC/cookiecutter-chrisapp/wiki/Automatic-Builds
#
# - targeted platforms: x86_64, PowerPC64, ARM64
# - master is built as fnndsc/pl-csv2json:latest
# - tagged commits are built as fnndsc/pl-csv2json:<tag>
# - master is built as fnndsc/pl-markimg:latest
# - tagged commits are built as fnndsc/pl-markimg:<tag>
# - tagged commits are also uploaded to chrisstore.co
#
# In order to use this workflow, see
Expand All @@ -21,8 +21,8 @@ on:

jobs:
test:
if: False
runs-on: ubuntu-20.04
if: false
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: build
Expand All @@ -32,7 +32,7 @@ jobs:

publish:
if: github.event_name == 'push' || github.event_name == 'release'
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

# we want to both push the build to DockerHub, but also
# keep a local copy so that we can run
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down Expand Up @@ -120,11 +120,16 @@ jobs:
docker pull localhost:5000/$dock_image
docker tag localhost:5000/$dock_image $dock_image
script=$(docker inspect --format '{{ (index .Config.Cmd 0) }}' $dock_image)
docker run --rm $dock_image $script --json > /tmp/description.json
jq <<< "$json" # pretty print in log
docker run --rm $dock_image $script --json \
| jq '. += {"name":"pl-csv2json", "dock_image": "'$dock_image'", "public_repo": "'${{ github.server_url }}/${{ github.repository }}'" }' \
> /tmp/description.json
json="$(docker run --rm $dock_image $script --json)"
# Escape single quotes
json_escaped=$(echo "$json" | sed "s/'/\\'/g")
echo "::set-output name=json::$json"
echo "::set-output name=title::$(jq -r '.title' <<< "$json")"
jq <<< "$json" # pretty print in log
echo "json=$json_escaped" >> $GITHUB_OUTPUT
echo "title=$(jq -r '.title' <<< "$json")" >> $GITHUB_OUTPUT
- name: Update DockerHub description
uses: peter-evans/dockerhub-description@v2
Expand All @@ -139,32 +144,10 @@ jobs:
- name: Upload ChRIS Plugin
id: upload
if: github.ref_type == 'tag'
run: |
auth='${{ secrets.CHRISPROJECT_USERNAME }}:${{ secrets.CHRISPROJECT_PASSWORD }}'
chris_url="https://cube.chrisproject.org/api/v1/"
admin_url="$(curl -sSf -u "$auth" $chris_url -H 'Accept: application/json' | jq -r '.collection_links.admin')"
compute_names="NERC"
if [ "$admin_url" = "null" ]; then
echo "::error ::${{ secrets.CHRISPROJECT_USERNAME }} is not an admin for $chris_url"
exit 1
fi
set +e
res="$(
curl -sS -u "$auth" "$admin_url" \
-H 'Accept: application/json' \
-F fname=@- \
-F compute_names=$compute_names \
< /tmp/description.json
)"
rc=$?
if [ "$rc" != "0" ]; then
echo "Description >>>"
cat /tmp/description.json
echo "Response >>>"
echo "$res"
echo "::error ::Failed to upload plugin to $admin_url"
exit "$rc"
fi
uses: FNNDSC/upload-chris-plugin@main
with:
description_file: /tmp/description.json
username: ${{ secrets.CHRISPROJECT_USERNAME }}
password: ${{ secrets.CHRISPROJECT_PASSWORD }}
chris_url: https://cube.chrisproject.org/api/v1/
compute_names: NERC
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = 'csv2json',
version = '1.3.6',
version = '1.3.7',
description = 'An app to convert CSV generated from pl-lld_inference to a JSON representation',
long_description = readme,
author = 'FNNDSC',
Expand Down

0 comments on commit c25b2a9

Please sign in to comment.