From d7bd6a20cab7e2c49549159de4883bb056d94b1a Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Wed, 5 Apr 2023 14:11:52 +0100 Subject: [PATCH] feat: upload docker-compose.yml to release and artifacts and fix typo in actions (#701) * feat: upload docker-compose.yml to release and artifacts and fix typo in actions - upload docker-compose.yml to release and artifacts - fix typo in actions Supersedes: #700 Relates-to: #693 * Update push-to-testnet-new-fleets-nebraos-cloud-draft.yml * feat: upload docker-compose.yml to release and artifacts and fix typo in actions - upload docker-compose.yml to release and artifacts - fix typo in actions Supersedes: #700 Relates-to: #693 --- ...to-prod-new-fleets-nebraos-cloud-draft.yml | 22 +++++++++++++++++-- .../push-to-prod-new-fleets-nebraos-cloud.yml | 22 +++++++++++++++++-- ...to-prod-old-fleets-nebraos-cloud-draft.yml | 20 ++++++++++++++++- .../push-to-prod-old-fleets-nebraos-cloud.yml | 20 ++++++++++++++++- ...testnet-new-fleets-nebraos-cloud-draft.yml | 22 +++++++++++++++++-- ...sh-to-testnet-new-fleets-nebraos-cloud.yml | 22 +++++++++++++++++-- ...testnet-old-fleets-nebraos-cloud-draft.yml | 20 ++++++++++++++++- ...sh-to-testnet-old-fleets-nebraos-cloud.yml | 20 ++++++++++++++++- 8 files changed, 156 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push-to-prod-new-fleets-nebraos-cloud-draft.yml b/.github/workflows/push-to-prod-new-fleets-nebraos-cloud-draft.yml index eec3393d..945e600e 100644 --- a/.github/workflows/push-to-prod-new-fleets-nebraos-cloud-draft.yml +++ b/.github/workflows/push-to-prod-new-fleets-nebraos-cloud-draft.yml @@ -30,6 +30,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -47,12 +49,28 @@ jobs: python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true - balena_command: "deploy nebraltd/${{ env.REPO}} --debug --nocache --build --draft" + balena_command: "deploy nebraltd/${{ env.REPO }} --debug --nocache --build --draft" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }} + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: ${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 with: diff --git a/.github/workflows/push-to-prod-new-fleets-nebraos-cloud.yml b/.github/workflows/push-to-prod-new-fleets-nebraos-cloud.yml index e93cd118..b9a8c1fc 100644 --- a/.github/workflows/push-to-prod-new-fleets-nebraos-cloud.yml +++ b/.github/workflows/push-to-prod-new-fleets-nebraos-cloud.yml @@ -33,6 +33,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -50,12 +52,28 @@ jobs: python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true - balena_command: "deploy nebraltd/${{ env.REPO}} --debug --nocache --build" + balena_command: "deploy nebraltd/${{ env.REPO }} --debug --nocache --build" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }} + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: ${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 with: diff --git a/.github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml b/.github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml index 7bc88d2c..99252531 100644 --- a/.github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml +++ b/.github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml @@ -94,6 +94,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -138,12 +140,28 @@ jobs: python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true balena_command: "deploy nebraltd/${{ env.REPO }} --debug --nocache --build --draft" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }} + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: ${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi' diff --git a/.github/workflows/push-to-prod-old-fleets-nebraos-cloud.yml b/.github/workflows/push-to-prod-old-fleets-nebraos-cloud.yml index b0377c6e..6f3e5d59 100644 --- a/.github/workflows/push-to-prod-old-fleets-nebraos-cloud.yml +++ b/.github/workflows/push-to-prod-old-fleets-nebraos-cloud.yml @@ -97,6 +97,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -141,11 +143,27 @@ jobs: python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true balena_command: "deploy nebraltd/${{ env.REPO }} --debug --nocache --build" + + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }} + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: ${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "This is helium-miner-software release ${{ env.LATEST_GA }}-${{ env.day }}" - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 diff --git a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud-draft.yml b/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud-draft.yml index f2fc05f2..d50bc102 100644 --- a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud-draft.yml +++ b/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud-draft.yml @@ -27,6 +27,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -44,12 +46,28 @@ jobs: python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true - balena_command: "deploy nebraltd/testnet-${{ env.REPO}} --debug --nocache --build --draft" + balena_command: "deploy nebraltd/testnet-${{ env.REPO }} --debug --nocache --build --draft" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }}.testnet + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: TESTNET-${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "TESTNET: This is helium-miner-software release TESTNET-${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 with: diff --git a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml b/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml index cfe0fb6a..a4ba87fa 100644 --- a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml +++ b/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml @@ -30,6 +30,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -47,12 +49,28 @@ jobs: python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true - balena_command: "deploy nebraltd/testnet-${{ env.REPO}} --debug --nocache --build" + balena_command: "deploy nebraltd/testnet-${{ env.REPO }} --debug --nocache --build" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }}.testnet + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: TESTNET-${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "TESTNET: This is helium-miner-software release TESTNET-${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 with: diff --git a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml b/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml index 30fb31ca..8a1ac138 100644 --- a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml +++ b/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml @@ -27,6 +27,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -66,12 +68,28 @@ jobs: python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true balena_command: "deploy nebraltd/${{ env.FLEET }} --debug --nocache --build --draft" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }}.testnet + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: TESTNET-${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "TESTNET: This is helium-miner-software release TESTNET-${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi' diff --git a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml b/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml index 33954497..e6f84c0c 100644 --- a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml +++ b/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml @@ -30,6 +30,8 @@ jobs: LATEST_GA=$FIRMWARE_VERSION GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) + echo "timestamp=$(date +'%s')" >> $GITHUB_ENV + echo "day=$(date +'%F')" >> $GITHUB_ENV echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV @@ -69,12 +71,28 @@ jobs: python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml - name: Balena Deploy - uses: nebraltd/balena-cli-action@v15.1.1 + uses: nebraltd/balena-cli-action@v15.1.2 with: balena_api_token: ${{secrets.NEBRAOS_CLOUD_TOKEN}} nebraos_cloud: true balena_command: "deploy nebraltd/${{ env.FLEET }} --debug --nocache --build" + - name: Upload docker-compose.yml artifact + uses: actions/upload-artifact@v3 + with: + name: docker-compose.yml.${{ env.REPO }}.testnet + path: docker-compose.yml + + - name: Upload docker-compose.yml to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: docker-compose.yml + asset_name: docker-compose.yml.${{ env.REPO }} + tag: TESTNET-${{ env.LATEST_GA }}-${{ env.day }} + overwrite: true + body: "TESTNET: This is helium-miner-software release TESTNET-${{ env.LATEST_GA }}-${{ env.day }}" + - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi'