b3d02e3ba7
* ns-api: remove sqlite support ns-api: add env var to skip migrations for local dev ns-api: tidy up imports ns-api: fix deserialisation fo node descriptions update dockerfile update README fix up README and example env ns-api: bump major version to 4 ns-api: add more geoip data and new performance field in dvpn responses * ability to import partial ticketbooks * wip: adding common ecash state to NS API * buffering ticketbooks * wip * distribute tickets when getting testrun assignment * passing ticketbook data to gateway probe * wrapped around storage tx * ticketbook query fixes * clippy * modified testrun assignment to always return tickets * Update version * Update push-node-status-agent.yaml * Update Cargo.toml * add entrypoint for ns agents * sqlx prepare and cargo fmt * clippy fixes * Update ci-check-ns-api-version.yml --------- Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com> Co-authored-by: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Co-authored-by: benedettadavico <benedetta.davico@gmail.com>
60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
name: ci-check-ns-api-version
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "nym-node-status-api/**"
|
|
|
|
env:
|
|
WORKING_DIRECTORY: "nym-node-status-api/nym-node-status-api"
|
|
|
|
jobs:
|
|
check-if-tag-exists:
|
|
runs-on: arc-linux-latest-dind
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get version from cargo.toml
|
|
uses: mikefarah/yq@v4.47.1
|
|
id: get_version
|
|
with:
|
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
|
|
|
- name: Check if git tag exists
|
|
run: |
|
|
TAG=${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
|
if [[ -z "$TAG" ]]; then
|
|
echo "Tag is empty"
|
|
exit 1
|
|
fi
|
|
git ls-remote --tags origin | awk '{print $2}'
|
|
if git ls-remote --tags origin | awk '{print $2}' | grep -q "refs/tags/$TAG$" ; then
|
|
echo "Tag '$TAG' ALREADY EXISTS on the remote"
|
|
exit 1
|
|
else
|
|
echo "Tag '$TAG' does not exist on the remote"
|
|
fi
|
|
- name: Check if harbor tag exists
|
|
run: |
|
|
TAG=${{ steps.get_version.outputs.result }}
|
|
registry=https://harbor.nymte.ch
|
|
repo_name=nym/node-status-api
|
|
if [[ -z $TAG ]]; then
|
|
echo "Tag is empty"
|
|
exit 1
|
|
fi
|
|
# first, list all tags for logging purposes
|
|
curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq
|
|
# check if there's a matching tag
|
|
exists=$(curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq -r --arg tag "$TAG" 'any(.tags[]; . == $tag)' )
|
|
if [[ $exists = "true" ]]; then
|
|
echo "Version '$TAG' defined in Cargo.toml ALREADY EXISTS as tag in harbor repo"
|
|
exit 1
|
|
elif [[ $exists = "false" ]]; then
|
|
echo "Version '$TAG' doesn't exist on the remote"
|
|
else
|
|
echo "Unknown output '$exists'"
|
|
exit 2
|
|
fi
|