From a52b908ef027a9f54d587f5fc5dfbcc1c7fb5a42 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Sat, 12 Oct 2024 00:58:05 +0200 Subject: [PATCH 1/4] Prevent automatic builds from going live accidently --- .github/workflows/release-factory.yml | 1 + .github/workflows/release.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/release-factory.yml b/.github/workflows/release-factory.yml index f505b584..d3e26f72 100644 --- a/.github/workflows/release-factory.yml +++ b/.github/workflows/release-factory.yml @@ -51,4 +51,5 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: + prerelease: true files: "esp-miner-factory-${{ matrix.build_type }}-${{ github.ref_name }}.bin" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a2c5159..255147d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,9 +53,11 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: + prerelease: true files: ./build/www.bin - name: Release esp-miner.bin uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: + prerelease: true files: ./build/esp-miner.bin From 6c36b200489738ac3bf4751bc29a3e343bfb566f Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Sat, 12 Oct 2024 17:09:43 +0200 Subject: [PATCH 2/4] Only publish when releasing --- .github/workflows/release-factory.yml | 9 ++++----- .github/workflows/release.yml | 11 +++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-factory.yml b/.github/workflows/release-factory.yml index d3e26f72..39c28378 100644 --- a/.github/workflows/release-factory.yml +++ b/.github/workflows/release-factory.yml @@ -1,8 +1,8 @@ -name: Build & Release Factory Images +name: Build & Release Factory Images [Release] + on: - push: - tags: - - '*' + release: + types: [released] jobs: build: @@ -51,5 +51,4 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - prerelease: true files: "esp-miner-factory-${{ matrix.build_type }}-${{ github.ref_name }}.bin" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 255147d2..54ccff42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ -name: Build & Release Firmware +name: Build & Release Firmware [Release] + on: - push: - tags: - - '*' + release: + types: [released] + jobs: build: runs-on: ubuntu-latest @@ -53,11 +54,9 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - prerelease: true files: ./build/www.bin - name: Release esp-miner.bin uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - prerelease: true files: ./build/esp-miner.bin From b4756e663ec81871f982141eeb5b7740540d8e5a Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Sat, 12 Oct 2024 17:10:26 +0200 Subject: [PATCH 3/4] Only publish when releasing --- .github/workflows/release-beta.yml | 64 ++++++++++++++++++++++ .github/workflows/release-factory-beta.yml | 55 +++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 .github/workflows/release-beta.yml create mode 100644 .github/workflows/release-factory-beta.yml diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml new file mode 100644 index 00000000..b4488eac --- /dev/null +++ b/.github/workflows/release-beta.yml @@ -0,0 +1,64 @@ +name: Build & Release Firmware [Pre-Release] + +on: + release: + types: [released] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Build web dist + working-directory: ./main/http_server/axe-os + run: | + npm ci + npm run build + - name: esp-idf build + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: v5.3.1 + target: esp32s3 + command: GITHUB_ACTIONS="true" idf.py build + path: '.' + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - run: pip install esptool + - name: "Create factory/merged image" + run: "./merge_bin.sh ./esp-miner-merged.bin" + - name: upload esp-miner-merged.bin + uses: actions/upload-artifact@v3 + with: + name: esp-miner-factory.bin + path: ./esp-miner-merged.bin + - name: upload esp-miner.bin + uses: actions/upload-artifact@v3 + with: + name: esp-miner.bin + path: ./build/esp-miner.bin + - name: upload www.bin + uses: actions/upload-artifact@v3 + with: + name: www.bin + path: ./build/www.bin + - name: Release www.bin + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: ./build/www.bin + - name: Release esp-miner.bin + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: ./build/esp-miner.bin diff --git a/.github/workflows/release-factory-beta.yml b/.github/workflows/release-factory-beta.yml new file mode 100644 index 00000000..19c4f4f5 --- /dev/null +++ b/.github/workflows/release-factory-beta.yml @@ -0,0 +1,55 @@ +name: Build & Release Factory Images [Pre-Release] + +on: + release: + types: [released] + +jobs: + build: + runs-on: ubuntu-latest + name: "Factory ${{ matrix.build_type }}" + strategy: + fail-fast: false + matrix: + build_type: ["102", "202", "204", "401", "402", "403", "601"] + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Build web dist + working-directory: ./main/http_server/axe-os + run: | + npm ci + npm run build + - name: esp-idf build + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: v5.3.1 + target: esp32s3 + command: GITHUB_ACTIONS="true" idf.py build + path: '.' + - name: "esp-idf build factory config for ${{ matrix.build_type }}" + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: v5.3.1 + target: esp32s3 + command: /opt/esp/idf/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py generate config-${{ matrix.build_type }}.cvs config.bin 0x6000 + path: '.' + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - run: pip install esptool + - name: "Create factory image for ${{ matrix.build_type }}-${{ github.ref_name }}" + run: "./merge_bin.sh -c esp-miner-factory-${{ matrix.build_type }}-${{ github.ref_name }}.bin" + - name: Release esp-miner.bin + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: "esp-miner-factory-${{ matrix.build_type }}-${{ github.ref_name }}.bin" From 4b3e5b4c5b3804bb89e1e45516aad21b7d18da77 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Sat, 12 Oct 2024 17:11:25 +0200 Subject: [PATCH 4/4] Only publish when releasing --- .github/workflows/release-beta.yml | 2 +- .github/workflows/release-factory-beta.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index b4488eac..7838b32e 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -2,7 +2,7 @@ name: Build & Release Firmware [Pre-Release] on: release: - types: [released] + types: [prereleased] jobs: build: diff --git a/.github/workflows/release-factory-beta.yml b/.github/workflows/release-factory-beta.yml index 19c4f4f5..fe082e37 100644 --- a/.github/workflows/release-factory-beta.yml +++ b/.github/workflows/release-factory-beta.yml @@ -2,7 +2,7 @@ name: Build & Release Factory Images [Pre-Release] on: release: - types: [released] + types: [prereleased] jobs: build: