diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4932ae8..d803cbc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -15,7 +15,8 @@ jobs: build_cmd: - ./build-latest.sh - PRERELEASE=true ./build-latest.sh - - ./build-branches.sh + - ./build-next.sh + - ./build.sh develop docker_from: - '' # use the default of the DOCKERFILE - python:3.7-alpine diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1796097..9dbf770 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,14 +14,15 @@ jobs: build_cmd: - ./build-latest.sh - PRERELEASE=true ./build-latest.sh - - ./build-branches.sh + - ./build-next.sh + - ./build.sh develop fail-fast: false runs-on: ubuntu-latest name: Builds new Netbox Docker Images steps: - id: git-checkout name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v2 - id: docker-build name: Build the image with '${{ matrix.build_cmd }}' run: ${{ matrix.build_cmd }} diff --git a/build-branches.sh b/build-next.sh similarity index 69% rename from build-branches.sh rename to build-next.sh index 483e771..c833d52 100755 --- a/build-branches.sh +++ b/build-next.sh @@ -23,25 +23,12 @@ GITHUB_REPO="${GITHUB_REPO-$ORIGINAL_GITHUB_REPO}" URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches?${GITHUB_OAUTH_PARAMS}" # Composing the JQ commans to extract the most recent version number -JQ_BRANCHES='map(.name) | .[] | scan("^[^v].+") | match("^(master|develop).*") | .string' +JQ_NEXT='map(.name) | .[] | scan("^[^v].+") | match("^(develop-).*") | .string' CURL="curl -sS" # Querying the Github API to fetch all branches -BRANCHES=$($CURL "${URL_RELEASES}" | jq -r "$JQ_BRANCHES") +NEXT=$($CURL "${URL_RELEASES}" | jq -r "$JQ_NEXT") -### -# Building each branch -### - -# keeping track whether an error occured -ERROR=0 - -# calling build.sh for each branch -for BRANCH in $BRANCHES; do - # shellcheck disable=SC2068 - ./build.sh "${BRANCH}" $@ || ERROR=1 -done - -# returning whether an error occured -exit $ERROR +# shellcheck disable=SC2068 +./build.sh "${NEXT}" $@