This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Update with Arduino CLI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - test_package_update | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-update: | |
| runs-on: ubuntu-22.04 | |
| # services: | |
| # docker: | |
| # image: docker:dind | |
| # options: --privileged --shm-size=2g | |
| # volumes: | |
| # - /var/run/docker.sock:/var/run/docker.sock:ro | |
| # container: | |
| # image: ubuntu:latest | |
| env: | |
| ARCH: amd64 | |
| APPCLI_REPO: arduino/arduino-app-cli | |
| ROUTER_REPO: arduino/arduino-router | |
| STABLE_DIR: build/stable | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| # - name: Set up Docker | |
| # uses: docker/setup-docker-action@v2 | |
| # - name: Set up Docker Buildx | |
| # uses: docker/setup-buildx-action@v3 | |
| - name: Install Task (go-task) | |
| run: | | |
| go tool task --version | |
| - name: Prepare folder | |
| run: | | |
| mkdir -p "${STABLE_DIR}" | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure Git for private repo cloning | |
| run: | | |
| git config --global url."https://${{ env.GITHUB_USERNAME }}:${{ env.GITHUB_TOKEN }}@github.com".insteadOf "https://github.com" | |
| - name: List assets for Arduino App CLI v0.6.6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl -H "Authorization: token ${GITHUB_TOKEN}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/arduino/arduino-app-cli/releases/tags/v0.6.6" \ | |
| | jq -r '.assets[] | "\(.name) -> \(.browser_download_url)"' | |
| - name: Download Arduino App CLI .deb | |
| run: | | |
| mkdir -p build/stable | |
| wget -O build/stable/arduino-app-cli_0.6.6_amd64.deb \ | |
| https://github.com/arduino/arduino-app-cli/releases/download/0.6.6/arduino-app-cli_0.6.6_amd64.deb | |
| - name: Download Arduino Router .deb | |
| run: | | |
| mkdir -p build/stable | |
| wget -O build/stable/arduino-router_0.5.3_amd64.deb \ | |
| https://github.com/arduino/arduino-router/releases/download/v0.5.3/arduino-router_0.5.3_amd64.deb | |
| - name: Build Docker image (no cache) | |
| run: | | |
| docker build --no-cache -t mock-apt-repo -f test.Dockerfile . | |
| - name: Run mock-apt-repo container | |
| run: | | |
| docker run --rm -d \ | |
| --privileged \ | |
| --cgroupns=host \ | |
| -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ | |
| -v /var/run/docker.sock:/var/run/docker.sock \ | |
| -e DOCKER_HOST=unix:///var/run/docker.sock \ | |
| --name apt-test-update \ | |
| mock-apt-repo | |
| - name: Verify container is running | |
| run: docker ps |