diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index bf2f7e6..8a50651 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -46,7 +46,6 @@ jobs: - name: Generate documentation run: | rebar3 ex_doc - cp installer/manifest.json doc/ - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/esp32-mkimage.yaml b/.github/workflows/esp32-mkimage.yaml index b098877..6d28535 100644 --- a/.github/workflows/esp32-mkimage.yaml +++ b/.github/workflows/esp32-mkimage.yaml @@ -14,6 +14,7 @@ on: paths: - '.github/workflows/esp32-mkimage.yaml' - 'src/**' + workflow_dispatch: permissions: contents: write @@ -23,10 +24,9 @@ concurrency: cancel-in-progress: true jobs: - esp32-release: + build-and-release: runs-on: ubuntu-latest container: espressif/idf:v${{ matrix.idf-version }} - strategy: matrix: idf-version: ["5.2"] @@ -55,11 +55,10 @@ jobs: elixir-version: ${{ matrix.elixir_version }} rebar3-version: '3.23.0' - - name: "APT update" - run: apt update -y - - - name: "Install deps" - run: DEBIAN_FRONTEND=noninteractive apt install -y ${{ matrix.compiler_pkgs}} git cmake gperf zlib1g-dev + - name: "Install dependencies" + run: | + apt update -y + DEBIAN_FRONTEND=noninteractive apt install -y ${{ matrix.compiler_pkgs}} git cmake gperf zlib1g-dev # needed for generating AtomVM version when running in a docker container - name: "Configure Git" @@ -149,7 +148,7 @@ jobs: - name: "Upload ${{ matrix.soc }} artifacts" uses: actions/upload-artifact@v3 with: - name: atomvm-${{ matrix.soc }}-image + name: atomvm-c3card-${{ matrix.soc }}-image path: ./AtomVM/src/platforms/esp32/build/atomvm-${{ matrix.soc }}.img if-no-files-found: error @@ -168,4 +167,57 @@ jobs: fail_on_unmatched_files: true files: | ./AtomVM/src/platforms/esp32/build/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img - ./AtomVM/src/platforms/esp32/build/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256 \ No newline at end of file + ./AtomVM/src/platforms/esp32/build/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256 + + publish: + name: "Publish new firmware and website to GitHub Pages" + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: [build-and-release] + strategy: + matrix: + idf-version: ["5.2"] + cc: ["clang-15"] + cxx: ["clang++-15"] + cflags: ["-O3"] + otp: ["26"] + elixir_version: ["1.16"] + compiler_pkgs: ["clang-15"] + soc: ["esp32c3"] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + - name: Setup Erlang + uses: erlef/setup-beam@v1 + with: + otp-version: '26.2' + rebar3-version: '3.23.0' + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Generate documentation + run: | + rebar3 ex_doc + - uses: actions/download-artifact@v4 + with: + path: output + - name: Create manifest.json + run: | + ATOMVM_IMG="AtomVM-${{ matrix.soc }}-${{ github.ref_name }}.img" + jq -n \ + --arg name "AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}" \ + --arg version "${{ github.run_number }}" \ + '{"name": $name, "version": $version, "files": [{"path": "AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img", "sha256": "$(cat ./output/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256)"}]}' > doc/manifest.json + ls -R . + mv output/atomvm-${{ matrix.soc }}.img doc/"${ATOMVM_IMG}" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: doc + - name: Deploy to Github Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/installer/manifest.json b/installer/manifest.json index 24b152d..54afe66 100644 --- a/installer/manifest.json +++ b/installer/manifest.json @@ -5,7 +5,7 @@ { "chipFamily": "ESP32-C3", "parts": [ - { "path": "https://github.com/esl/c3card/releases/download/v0.2.0/AtomVM-c3card-esp32c3-master.img", "offset": 0 } + { "path": "https://github.io/esl/c3card/releases/download/latest/AtomVM-c3card-esp32c3-master.img", "offset": 0 } ] } ]