diff --git a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml b/.github/workflows/push-to-testnet-nebraos-cloud-draft.yml similarity index 83% rename from .github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml rename to .github/workflows/push-to-testnet-nebraos-cloud-draft.yml index 8a1ac138..de98096a 100644 --- a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud-draft.yml +++ b/.github/workflows/push-to-testnet-nebraos-cloud-draft.yml @@ -1,4 +1,4 @@ -name: NebraOS Cloud Deploy (Testnet - old fleets - draft) +name: NebraOS Cloud Deploy (Testnet - draft) on: workflow_dispatch: @@ -43,23 +43,29 @@ jobs: variant="nebra-indoor1" fleet="helium-testnet" repo="helium-$variant" + repo2="helium-nebra-outdoor1" elif [[ "$miner" == "rockpi" ]] ; then variant="nebra-indoor2" fleet="helium-testnet-rockpi" repo="helium-$variant" + repo2="helium-nebra-outdoor2" elif [[ "$miner" == "og" ]] ; then variant="helium-fl1" fleet="helium-testnet-og" repo="helium-og" + repo2="None" else variant="$miner-fl1" fleet="helium-testnet-$miner" repo="helium-$miner" + repo2="None" fi echo "Variant: $variant" echo "REPO=$repo" >> $GITHUB_ENV echo "Repo: $repo" + echo "REPO2=$repo2" >> $GITHUB_ENV + echo "Repo 2: $repo2" echo "FLEET=$fleet" >> $GITHUB_ENV echo "Fleet: $fleet" @@ -92,9 +98,17 @@ jobs: - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 - if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi' with: token: ${{ secrets.MR_BUMP }} event-type: build-open-fleet repository: NebraLtd/${{ env.REPO }} client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"}' + + - name: Trigger build action in ${{ env.REPO2 }} repo + uses: peter-evans/repository-dispatch@v2 + if: matrix.sbc == 'raspi' || matrix.sbc == 'rockpi' + with: + token: ${{ secrets.MR_BUMP }} + event-type: build-open-fleet + repository: NebraLtd/${{ env.REPO2 }} + client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"} diff --git a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml b/.github/workflows/push-to-testnet-nebraos-cloud.yml similarity index 83% rename from .github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml rename to .github/workflows/push-to-testnet-nebraos-cloud.yml index e6f84c0c..ec130c7c 100644 --- a/.github/workflows/push-to-testnet-old-fleets-nebraos-cloud.yml +++ b/.github/workflows/push-to-testnet-nebraos-cloud.yml @@ -1,4 +1,4 @@ -name: NebraOS Cloud Deploy (Testnet - old fleets) +name: NebraOS Cloud Deploy (Testnet) on: push: @@ -46,23 +46,29 @@ jobs: variant="nebra-indoor1" fleet="helium-testnet" repo="helium-$variant" + repo2="helium-nebra-outdoor1" elif [[ "$miner" == "rockpi" ]] ; then variant="nebra-indoor2" fleet="helium-testnet-rockpi" repo="helium-$variant" + repo2="helium-nebra-outdoor2" elif [[ "$miner" == "og" ]] ; then variant="helium-fl1" fleet="helium-testnet-og" repo="helium-og" + repo2="None" else variant="$miner-fl1" fleet="helium-testnet-$miner" repo="helium-$miner" + repo2="None" fi echo "Variant: $variant" echo "REPO=$repo" >> $GITHUB_ENV echo "Repo: $repo" + echo "REPO2=$repo2" >> $GITHUB_ENV + echo "Repo 2: $repo2" echo "FLEET=$fleet" >> $GITHUB_ENV echo "Fleet: $fleet" @@ -95,9 +101,17 @@ jobs: - name: Trigger build action in ${{ env.REPO }} repo uses: peter-evans/repository-dispatch@v2 - if: matrix.sbc != 'raspi' && matrix.sbc != 'rockpi' with: token: ${{ secrets.MR_BUMP }} event-type: build-open-fleet repository: NebraLtd/${{ env.REPO }} client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"}' + + - name: Trigger build action in ${{ env.REPO2 }} repo + uses: peter-evans/repository-dispatch@v2 + if: matrix.sbc == 'raspi' || matrix.sbc == 'rockpi' + with: + token: ${{ secrets.MR_BUMP }} + event-type: build-open-fleet + repository: NebraLtd/${{ env.REPO2 }} + client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"} 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 deleted file mode 100644 index d50bc102..00000000 --- a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud-draft.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: NebraOS Cloud Deploy (Testnet - Draft Deploy) - -on: - workflow_dispatch: - -jobs: - testnet: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - variant: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2] # TODO add nebra-light2 later - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python Libraries - run: pip install -r requirements.txt - - - name: Export short SHA of current commit - run: | - FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} ) - echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV - - # Get the latest GA release and branch - source <(grep FIRMWARE_VERSION settings.ini) - 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 - - - name: Random sleep (balena API workaround) - run: sleep $[ ( $RANDOM % 360 ) + 1 ]s - - - name: Generate Docker Compose - run: | - repo="helium-${{matrix.variant}}" - echo "REPO=$repo" >> $GITHUB_ENV - echo "Repo: $repo" - - FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }} - - python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - - - name: Balena Deploy - 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" - - - 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: - token: ${{ secrets.MR_BUMP }} - event-type: build-open-fleet - repository: NebraLtd/${{ env.REPO }} - client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"}' diff --git a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml b/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml deleted file mode 100644 index a4ba87fa..00000000 --- a/.github/workflows/push-to-testnet-new-fleets-nebraos-cloud.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: NebraOS Cloud Deploy (Testnet) - -on: - push: - # Only run workflow for pushes to specific branches - branches: - - master - -jobs: - testnet: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - variant: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2] # TODO add nebra-light2 later - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Python Libraries - run: pip install -r requirements.txt - - - name: Export short SHA of current commit - run: | - FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} ) - echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV - - # Get the latest GA release and branch - source <(grep FIRMWARE_VERSION settings.ini) - 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 - - - name: Random sleep (balena API workaround) - run: sleep $[ ( $RANDOM % 360 ) + 1 ]s - - - name: Generate Docker Compose - run: | - repo="helium-${{matrix.variant}}" - echo "REPO=$repo" >> $GITHUB_ENV - echo "Repo: $repo" - - FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }} - - python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml - - - name: Balena Deploy - 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" - - - 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: - token: ${{ secrets.MR_BUMP }} - event-type: build-open-fleet - repository: NebraLtd/${{ env.REPO }} - client-payload: '{"release": "${{ env.LATEST_GA }}_GA", "tag": "${{ env.LATEST_GA }}", "firmware": "${{ env.FIRMWARE_SHORT_HASH }}", "branch": "${{ env.GITHUB_BRANCH }}"}'