Skip to content

Commit

Permalink
Fix CORS request for the web installer
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Lanziano <ricardo.lanziano@erlang-solutions.com>
  • Loading branch information
arpunk committed May 8, 2024
1 parent b25c722 commit f60cd5a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
48 changes: 40 additions & 8 deletions .github/workflows/esp32-mkimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
paths:
- '.github/workflows/esp32-mkimage.yaml'
- 'src/**'
workflow_dispatch:

permissions:
contents: write
Expand All @@ -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"]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -168,4 +167,37 @@ 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
./AtomVM/src/platforms/esp32/build/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256
publish:
name: "Publish new firmware and website to GitHub Pages"
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:
- uses: actions/checkout@v3.5.3
- uses: actions/download-artifact@v3.0.2
with:
path: output
name: atomvm-${{ matrix.soc }}-image
- name: Create manifest.json
run: |
jq -n \
--arg name "AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}" \
--arg version "${{ github.run_number }}" \
'{"name": $name, "version": $version, "files": [{"path": "./output/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img", "sha256": "$(cat ./output/AtomVM-c3card-${{ matrix.soc }}-${{ github.ref_name }}.img.sha256)"}]}' > output/manifest.json
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: output
clean: true
2 changes: 1 addition & 1 deletion installer/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
]
}
]
Expand Down

0 comments on commit f60cd5a

Please sign in to comment.