Compare commits

...

12 Commits

Author SHA1 Message Date
Peter Johanson
ff7ef761d0 feat: Move ssh to build package.
* Some builds might need to pull extra west modules/sub-modules over
  SSH, so move that package to the build image.

Fixes: #142
2023-06-05 12:55:32 -06:00
Peter Johanson
76376c9148 feat: Bump to Zephyr SDK 0.15.2. 2022-12-23 02:05:58 -06:00
Peter Johanson
b4cab4d5a9 Merge branch '3.0-branch' into 3.2-branch 2022-11-03 12:00:43 -04:00
Peter Johanson
9b1bbf4a06 refactor: Move to new actions/checkout. 2022-11-03 11:00:05 -05:00
Peter Johanson
aedbb92f63 refactor: Move to $GITHUB_OUTPUT for step outputs. 2022-11-03 11:00:05 -05:00
Peter Johanson
2eba1525f4 Merge branch '3.0-branch' into 3.2-branch
* Bring in Node version bump, deps bumps, etc.
2022-10-28 22:47:05 -04:00
dependabot[bot]
0712f5046d build(deps): bump docker/setup-buildx-action from 1 to 2
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-28 14:22:46 -05:00
Peter Johanson
2f5f1ed561 chore: Bump a ton of deps. 2022-10-28 12:59:24 -05:00
Peter Johanson
0793ce8183 feat: Use skopeo copy to create multi-arch tags.
* Avoid plain `docker tag` to create stable/versioned tags, as this
  creates single architecture image tags, instead of a new manifest list
* Use `skopeo copy` instead for this!
2022-10-27 00:19:17 -05:00
Peter Johanson
64526ce2de feat: Update to new Node 18 LTS version. 2022-10-26 23:30:03 -05:00
Peter Johanson
a3c3bca1c9 fix: Disable git unsafe directory checks.
* git directory safety checks cause issues for CI, so disabling them.
2022-10-18 20:58:45 -05:00
Peter Johanson
2f5fa1a7e9 feat: Move to Zephyr 3.2/SDK 0.15.2
* SDK 0.15 supports a few more target architectures
* SDK was refactored to minimal zip then download toolchains, so refactor to that.
2022-10-18 20:58:45 -05:00
3 changed files with 126 additions and 127 deletions

View File

@ -1,8 +1,8 @@
name: Containers name: Containers
env: env:
zephyr-version: 3.0.0 zephyr-version: 3.2.0
zephyr-sdk-version: 0.13.2 zephyr-sdk-version: 0.15.2
sha-abbrev-length: 12 sha-abbrev-length: 12
no-cache: ${{ secrets.NO_CACHE != null || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} no-cache: ${{ secrets.NO_CACHE != null || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
ignore-actions-cache: ${{ secrets.IGNORE_ACTIONS_CACHE != null }} ignore-actions-cache: ${{ secrets.IGNORE_ACTIONS_CACHE != null }}
@ -32,22 +32,19 @@ jobs:
steps: steps:
- name: Timestamp - name: Timestamp
id: timestamp id: timestamp
run: echo ::set-output name=timestamp::$(date +%Y%m%d%H%M%S) run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
architectures: architectures:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
json: ${{ steps.import.outputs.json }} json: ${{ steps.import.outputs.json }}
steps: steps:
- name: Install yaml2json
run: python3 -m pip install remarshal
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Import from architectures.yml - name: Import from architectures.yml
id: import id: import
shell: python run: echo "json=$(yaml2json architectures.yml | jq -c .)" >> $GITHUB_OUTPUT
run: |
import yaml, json
with open('architectures.yml', 'r') as file:
architectures = yaml.safe_load(file)
print('::set-output name=json::' + json.dumps(architectures))
tags: tags:
needs: needs:
- timestamp - timestamp
@ -81,12 +78,12 @@ jobs:
MAJOR_MINOR=${MAJOR}.${MINOR} MAJOR_MINOR=${MAJOR}.${MINOR}
MAJOR_MINOR_BRANCH=${MAJOR_MINOR}-branch MAJOR_MINOR_BRANCH=${MAJOR_MINOR}-branch
echo ::set-output name=branch::${BRANCH} echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=base::${BASE} echo "base=${BASE}" >> $GITHUB_OUTPUT
echo ::set-output name=candidate::${CANDIDATE} echo "candidate=${CANDIDATE}" >> $GITHUB_OUTPUT
echo ::set-output name=versions::${VERSIONS} echo "versions=${VERSIONS}" >> $GITHUB_OUTPUT
echo ::set-output name=major-minor::${MAJOR_MINOR} echo "major-minor=${MAJOR_MINOR}" >> $GITHUB_OUTPUT
echo ::set-output name=major-minor-branch::${MAJOR_MINOR_BRANCH} echo "major-minor-branch=${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
dev-generic: dev-generic:
needs: needs:
- timestamp - timestamp
@ -97,14 +94,14 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: docker-hub-login id: docker-hub-login
if: ${{ env.docker-hub-credentials == 'true' }} if: ${{ env.docker-hub-credentials == 'true' }}
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
if: ${{ env.ghcr-credentials == 'true' }} if: ${{ env.ghcr-credentials == 'true' }}
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }} username: ${{ secrets.GHCR_USERNAME }}
@ -119,18 +116,18 @@ jobs:
BASE: ${{ needs.tags.outputs.base }} BASE: ${{ needs.tags.outputs.base }}
MAJOR_MINOR_BRANCH: ${{ needs.tags.outputs.major-minor-branch }} MAJOR_MINOR_BRANCH: ${{ needs.tags.outputs.major-minor-branch }}
run: | run: |
echo ::set-output name=local::/tmp/.buildx/dev-generic echo "local=/tmp/.buildx/dev-generic" >> $GITHUB_OUTPUT
echo ::set-output name=local-new::/tmp/.buildx/dev-generic-new echo "local-new=/tmp/.buildx/dev-generic-new" >> $GITHUB_OUTPUT
echo ::set-output name=branch::docker.io/${NS}/${REPOSITORY}:${BRANCH} echo "branch=docker.io/${NS}/${REPOSITORY}:${BRANCH}" >> $GITHUB_OUTPUT
if [ ! -z "$BASE" ]; then if [ ! -z "$BASE" ]; then
echo ::set-output name=base::docker.io/${NS}/${REPOSITORY}:${BASE} echo "base=docker.io/${NS}/${REPOSITORY}:${BASE}" >> $GITHUB_OUTPUT
fi fi
echo ::set-output name=major-minor-branch::docker.io/${NS}/${REPOSITORY}:${MAJOR_MINOR_BRANCH} echo "major-minor-branch=docker.io/${NS}/${REPOSITORY}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=branch-upstream::docker.io/${NSU}/${REPOSITORY}:${BRANCH} echo "branch-upstream=docker.io/${NSU}/${REPOSITORY}:${BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=major-minor-branch-upstream::docker.io/${NSU}/${REPOSITORY}:${MAJOR_MINOR_BRANCH} echo "major-minor-branch-upstream=docker.io/${NSU}/${REPOSITORY}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
- name: Set up cache - name: Set up cache
id: cache id: cache
uses: actions/cache@v2 uses: actions/cache@v3
env: env:
cache-name: dev-generic cache-name: dev-generic
with: with:
@ -139,11 +136,11 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}/${{ env.cache-name }}/${{ github.run_id }} ${{ runner.os }}/${{ env.cache-name }}/${{ github.run_id }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Build to local cache - name: Build to local cache
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: dev-generic target: dev-generic
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
@ -160,7 +157,7 @@ jobs:
cache-to: type=local,dest=${{ steps.paths.outputs.local-new }},mode=max cache-to: type=local,dest=${{ steps.paths.outputs.local-new }},mode=max
- name: Push to registry cache - name: Push to registry cache
if: ${{ env.docker-hub-credentials == 'true' }} if: ${{ env.docker-hub-credentials == 'true' }}
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: dev-generic target: dev-generic
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
@ -203,14 +200,14 @@ jobs:
- name: Login to Docker Hub - name: Login to Docker Hub
id: docker-hub-login id: docker-hub-login
if: ${{ env.docker-hub-credentials == 'true' }} if: ${{ env.docker-hub-credentials == 'true' }}
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
if: ${{ env.ghcr-credentials == 'true' }} if: ${{ env.ghcr-credentials == 'true' }}
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }} username: ${{ secrets.GHCR_USERNAME }}
@ -219,8 +216,8 @@ jobs:
id: repositories id: repositories
shell: bash shell: bash
run: | run: |
echo ::set-output name=build::zmk-build-${{ matrix.architecture }} echo "build=zmk-build-${{ matrix.architecture }}" >> $GITHUB_OUTPUT
echo ::set-output name=dev::zmk-dev-${{ matrix.architecture }} echo "dev=zmk-dev-${{ matrix.architecture }}" >> $GITHUB_OUTPUT
- name: Define paths - name: Define paths
id: paths id: paths
shell: bash shell: bash
@ -234,23 +231,23 @@ jobs:
BASE: ${{ needs.tags.outputs.base }} BASE: ${{ needs.tags.outputs.base }}
MAJOR_MINOR_BRANCH: ${{ needs.tags.outputs.major-minor-branch }} MAJOR_MINOR_BRANCH: ${{ needs.tags.outputs.major-minor-branch }}
run: | run: |
echo ::set-output name=dev-generic::/tmp/.buildx/dev-generic echo "dev-generic=/tmp/.buildx/dev-generic" >> $GITHUB_OUTPUT
echo ::set-output name=build-candidate::docker.io/${NS}/${BUILD}:${CANDIDATE} echo "build-candidate=docker.io/${NS}/${BUILD}:${CANDIDATE}" >> $GITHUB_OUTPUT
echo ::set-output name=build-branch::docker.io/${NS}/${BUILD}:${BRANCH} echo "build-branch=docker.io/${NS}/${BUILD}:${BRANCH}" >> $GITHUB_OUTPUT
if [ ! -z "$BASE" ]; then if [ ! -z "$BASE" ]; then
echo ::set-output name=build-base::docker.io/${NS}/${BUILD}:${BASE} echo "build-base=docker.io/${NS}/${BUILD}:${BASE}" >> $GITHUB_OUTPUT
fi fi
echo ::set-output name=build-major-minor-branch::docker.io/${NS}/${BUILD}:${MAJOR_MINOR_BRANCH} echo "build-major-minor-branch=docker.io/${NS}/${BUILD}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=build-branch-upstream::docker.io/${NSU}/${BUILD}:${BRANCH} echo "build-branch-upstream=docker.io/${NSU}/${BUILD}:${BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=build-major-minor-branch-upstream::docker.io/${NSU}/${BUILD}:${MAJOR_MINOR_BRANCH} echo "build-major-minor-branch-upstream=docker.io/${NSU}/${BUILD}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=dev-candidate::docker.io/${NS}/${DEV}:${CANDIDATE} echo "dev-candidate=docker.io/${NS}/${DEV}:${CANDIDATE}" >> $GITHUB_OUTPUT
echo ::set-output name=dev-branch::docker.io/${NS}/${DEV}:${BRANCH} echo "dev-branch=docker.io/${NS}/${DEV}:${BRANCH}" >> $GITHUB_OUTPUT
if [ ! -z "$BASE" ]; then if [ ! -z "$BASE" ]; then
echo ::set-output name=dev-base::docker.io/${NS}/${DEV}:${BASE} echo "dev-base=docker.io/${NS}/${DEV}:${BASE}" >> $GITHUB_OUTPUT
fi fi
echo ::set-output name=dev-major-minor-branch::docker.io/${NS}/${DEV}:${MAJOR_MINOR_BRANCH} echo "dev-major-minor-branch=docker.io/${NS}/${DEV}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=dev-branch-upstream::docker.io/${NSU}/${DEV}:${BRANCH} echo "dev-branch-upstream=docker.io/${NSU}/${DEV}:${BRANCH}" >> $GITHUB_OUTPUT
echo ::set-output name=dev-major-minor-branch-upstream::docker.io/${NSU}/${DEV}:${MAJOR_MINOR_BRANCH} echo "dev-major-minor-branch-upstream=docker.io/${NSU}/${DEV}:${MAJOR_MINOR_BRANCH}" >> $GITHUB_OUTPUT
- name: Define build-args - name: Define build-args
id: build-args id: build-args
shell: bash shell: bash
@ -260,12 +257,11 @@ jobs:
ARCHITECTURE=${{ matrix.architecture }} ARCHITECTURE=${{ matrix.architecture }}
ZEPHYR_SDK_VERSION=${{ env.zephyr-sdk-version }} ZEPHYR_SDK_VERSION=${{ env.zephyr-sdk-version }}
" "
# Escapes %, \n and \r
# See: https://github.community/t/set-output-truncates-multiline-strings/16852 delimiter="$(openssl rand -hex 8)"
LIST="${LIST//'%'/'%25'}" echo "list<<${delimiter}" >> $GITHUB_OUTPUT
LIST="${LIST//$'\n'/'%0A'}" echo "${LIST}" >> $GITHUB_OUTPUT
LIST="${LIST//$'\r'/'%0D'}" echo "${delimiter}" >> $GITHUB_OUTPUT
echo ::set-output name=list::${LIST}
- name: Define labels - name: Define labels
id: labels id: labels
shell: bash shell: bash
@ -274,26 +270,25 @@ jobs:
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.revision=${{ github.sha }}
" "
# Escapes %, \n and \r delimiter="$(openssl rand -hex 8)"
# See: https://github.community/t/set-output-truncates-multiline-strings/16852
LIST="${LIST//'%'/'%25'}" echo "list<<${delimiter}" >> $GITHUB_OUTPUT
LIST="${LIST//$'\n'/'%0A'}" echo "${LIST}" >> $GITHUB_OUTPUT
LIST="${LIST//$'\r'/'%0D'}" echo "${delimiter}" >> $GITHUB_OUTPUT
echo ::set-output name=list::${LIST}
- name: Set up dev-generic cache - name: Set up dev-generic cache
id: dev-generic-cache id: dev-generic-cache
uses: actions/cache@v2 uses: actions/cache@v3
env: env:
cache-name: dev-generic cache-name: dev-generic
with: with:
path: ${{ steps.paths.outputs.dev-generic }} path: ${{ steps.paths.outputs.dev-generic }}
key: ${{ runner.os }}/${{ env.cache-name }}/${{ github.run_id }}/${{ needs.timestamp.outputs.timestamp }} key: ${{ runner.os }}/${{ env.cache-name }}/${{ github.run_id }}/${{ needs.timestamp.outputs.timestamp }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Build and load 'build' candidate image - name: Build and load 'build' candidate image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: build target: build
build-args: | build-args: |
@ -314,7 +309,7 @@ jobs:
cache-to: type=inline cache-to: type=inline
load: true load: true
- name: Build and load 'dev' candidate image - name: Build and load 'dev' candidate image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: dev target: dev
build-args: | build-args: |
@ -336,12 +331,12 @@ jobs:
cache-to: type=inline cache-to: type=inline
load: true load: true
- name: Checkout ZMK - name: Checkout ZMK
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
repository: ${{ env.zmk-repository }} repository: ${{ env.zmk-repository }}
ref: ${{ env.zmk-ref }} ref: ${{ env.zmk-ref }}
- name: Cache Zephyr modules - name: Cache Zephyr modules
uses: actions/cache@v2 uses: actions/cache@v3
env: env:
cache-name: zephyr-modules cache-name: zephyr-modules
with: with:
@ -437,7 +432,7 @@ jobs:
run: docker stop candidate run: docker stop candidate
- name: Build and push 'build' candidate image (x86_64 and arm64) - name: Build and push 'build' candidate image (x86_64 and arm64)
if: ${{ steps.docker-hub-login.outcome == 'success' }} if: ${{ steps.docker-hub-login.outcome == 'success' }}
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: build target: build
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
@ -460,7 +455,7 @@ jobs:
push: true push: true
- name: Build and push 'dev' candidate image (x86_64 + arm64) - name: Build and push 'dev' candidate image (x86_64 + arm64)
if: ${{ steps.docker-hub-login.outcome == 'success' }} if: ${{ steps.docker-hub-login.outcome == 'success' }}
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
target: dev target: dev
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
@ -514,28 +509,28 @@ jobs:
TAG=${GITHUB_REF#refs/tags/} TAG=${GITHUB_REF#refs/tags/}
PATTERN="^(.+?)-((([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))(([01]?[0-9]|2[0-3])([0-5][0-9])([0-5][0-9])))-(([0-9]+)\.([0-9]+)\.([0-9]+))-(([0-9]+)\.([0-9]+)\.([0-9]+))-([0-9a-fA-F]+)-([0-9]+)$" PATTERN="^(.+?)-((([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))(([01]?[0-9]|2[0-3])([0-5][0-9])([0-5][0-9])))-(([0-9]+)\.([0-9]+)\.([0-9]+))-(([0-9]+)\.([0-9]+)\.([0-9]+))-([0-9a-fA-F]+)-([0-9]+)$"
if [[ "${TAG}" =~ $PATTERN ]]; then if [[ "${TAG}" =~ $PATTERN ]]; then
echo ::set-output name=tag::${TAG} echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo ::set-output name=branch::${BASH_REMATCH[1]} echo "branch=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
echo ::set-output name=datetime::${BASH_REMATCH[2]} echo "datetime=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
echo ::set-output name=date::${BASH_REMATCH[3]} echo "date=${BASH_REMATCH[3]}" >> $GITHUB_OUTPUT
echo ::set-output name=year::${BASH_REMATCH[4]} echo "year=${BASH_REMATCH[4]}" >> $GITHUB_OUTPUT
echo ::set-output name=month::${BASH_REMATCH[5]} echo "month=${BASH_REMATCH[5]}" >> $GITHUB_OUTPUT
echo ::set-output name=day::${BASH_REMATCH[6]} echo "day=${BASH_REMATCH[6]}" >> $GITHUB_OUTPUT
echo ::set-output name=time::${BASH_REMATCH[7]} echo "time=${BASH_REMATCH[7]}" >> $GITHUB_OUTPUT
echo ::set-output name=hour::${BASH_REMATCH[8]} echo "hour=${BASH_REMATCH[8]}" >> $GITHUB_OUTPUT
echo ::set-output name=minute::${BASH_REMATCH[9]} echo "minute=${BASH_REMATCH[9]}" >> $GITHUB_OUTPUT
echo ::set-output name=second::${BASH_REMATCH[10]} echo "second=${BASH_REMATCH[10]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-version::${BASH_REMATCH[11]} echo "zephyr-version=${BASH_REMATCH[11]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-version-major::${BASH_REMATCH[12]} echo "zephyr-version-major=${BASH_REMATCH[12]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-version-minor::${BASH_REMATCH[13]} echo "zephyr-version-minor=${BASH_REMATCH[13]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-version-patch::${BASH_REMATCH[14]} echo "zephyr-version-patch=${BASH_REMATCH[14]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-sdk-version::${BASH_REMATCH[15]} echo "zephyr-sdk-version=${BASH_REMATCH[15]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-sdk-version-major::${BASH_REMATCH[16]} echo "zephyr-sdk-version-major=${BASH_REMATCH[16]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-sdk-version-minor::${BASH_REMATCH[17]} echo "zephyr-sdk-version-minor=${BASH_REMATCH[17]}" >> $GITHUB_OUTPUT
echo ::set-output name=zephyr-sdk-version-patch::${BASH_REMATCH[18]} echo "zephyr-sdk-version-patch=${BASH_REMATCH[18]}" >> $GITHUB_OUTPUT
SHA=${BASH_REMATCH[19]} SHA=${BASH_REMATCH[19]}
echo ::set-output name=sha::${SHA} echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo ::set-output name=run-id::${BASH_REMATCH[20]} echo "run-id=${BASH_REMATCH[20]}" >> $GITHUB_OUTPUT
if [[ "${{ github.sha }}" != ${SHA}* ]]; then if [[ "${{ github.sha }}" != ${SHA}* ]]; then
echo "Hashes do not match!" echo "Hashes do not match!"
@ -560,16 +555,18 @@ jobs:
- build - build
- dev - dev
steps: steps:
- name: Install skopeo
run: sudo apt-get install -y skopeo
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }} username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }} password: ${{ secrets.GHCR_TOKEN }}
- name: Login to Docker Hub - name: Login to Docker Hub
id: docker-hub-login id: docker-hub-login
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
@ -585,18 +582,11 @@ jobs:
run: | run: |
REPOSITORY=zmk-${TARGET}-${ARCHITECTURE} REPOSITORY=zmk-${TARGET}-${ARCHITECTURE}
docker pull docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:${VERSIONS}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:${VERSIONS} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
docker push docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE}
docker push docker.io/${DHNS}/${REPOSITORY}:${VERSIONS}
docker push docker.io/${DHNS}/${REPOSITORY}:${MAJOR_MINOR}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${CANDIDATE}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${VERSIONS}
docker push ghcr.io/${GHCRNS}/${REPOSITORY}:${MAJOR_MINOR}
git-tag: git-tag:
needs: needs:
- tags - tags
@ -604,7 +594,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Tag - name: Tag
env: env:
TAG: ${{ needs.tags.outputs.major-minor }} TAG: ${{ needs.tags.outputs.major-minor }}
@ -624,8 +614,8 @@ jobs:
TAG=${GITHUB_REF#refs/tags/} TAG=${GITHUB_REF#refs/tags/}
PATTERN="^(.+?)-stable$" PATTERN="^(.+?)-stable$"
if [[ "${TAG}" =~ $PATTERN ]]; then if [[ "${TAG}" =~ $PATTERN ]]; then
echo ::set-output name=tag::${TAG} echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo ::set-output name=stable-tag::${BASH_REMATCH[1]} echo "stable-tag=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
else else
echo "Tag not recognised, ignoring ..." echo "Tag not recognised, ignoring ..."
fi fi
@ -643,16 +633,18 @@ jobs:
- build - build
- dev - dev
steps: steps:
- name: Install skopeo
run: sudo apt-get install -y skopeo
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
id: ghcr-login id: ghcr-login
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }} username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }} password: ${{ secrets.GHCR_TOKEN }}
- name: Login to Docker Hub - name: Login to Docker Hub
id: docker-hub-login id: docker-hub-login
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }} password: ${{ secrets.DOCKER_HUB_TOKEN }}
@ -666,10 +658,7 @@ jobs:
run: | run: |
REPOSITORY=zmk-${TARGET}-${ARCHITECTURE} REPOSITORY=zmk-${TARGET}-${ARCHITECTURE}
docker pull docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} skopeo copy --all docker://docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker://docker.io/${DHNS}/${REPOSITORY}:stable
docker tag docker.io/${DHNS}/${REPOSITORY}:${CANDIDATE} docker.io/${DHNS}/${REPOSITORY}:stable
docker push docker.io/${DHNS}/${REPOSITORY}:stable
stable-git-tag: stable-git-tag:
needs: needs:
- tags - tags
@ -677,7 +666,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
ref: ${{ needs.stable-release-trigger.outputs.stable-tag }} ref: ${{ needs.stable-release-trigger.outputs.stable-tag }}
- name: Tag - name: Tag

View File

@ -23,6 +23,7 @@ RUN \
python3-pip \ python3-pip \
python3-setuptools \ python3-setuptools \
python3-wheel \ python3-wheel \
ssh \
&& pip3 install \ && pip3 install \
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/v${ZEPHYR_VERSION}/scripts/requirements-base.txt \ -r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/v${ZEPHYR_VERSION}/scripts/requirements-base.txt \
&& pip3 install cmake \ && pip3 install cmake \
@ -45,7 +46,7 @@ RUN \
apt-get -y update \ apt-get -y update \
&& apt-get -y install --no-install-recommends \ && apt-get -y install --no-install-recommends \
curl \ curl \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \ && curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get -y update \ && apt-get -y update \
&& apt-get -y install --no-install-recommends \ && apt-get -y install --no-install-recommends \
clang-format \ clang-format \
@ -65,7 +66,6 @@ RUN \
python3-tk \ python3-tk \
python3-wheel \ python3-wheel \
socat \ socat \
ssh \
tio \ tio \
wget \ wget \
xz-utils \ xz-utils \
@ -88,14 +88,21 @@ ARG ARCHITECTURE
ARG ZEPHYR_SDK_VERSION ARG ZEPHYR_SDK_VERSION
ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${ZEPHYR_SDK_VERSION} ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
RUN \ RUN \
export sdk_file_name="zephyr-toolchain-${ARCHITECTURE}-${ZEPHYR_SDK_VERSION}-linux-$(uname -m)-setup.run" \ export minimal_sdk_file_name="zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-$(uname -m)_minimal" \
&& if [ "${ARCHITECTURE}" = "arm" ]; then arch_format="eabi"; else arch_format="elf"; fi \
&& if [ "${ARCHITECTURE#xtensa}" = "${ARCHITECTURE}" ]; then arch_sep="-"; else arch_sep="_"; fi \
&& apt-get -y update \ && apt-get -y update \
&& apt-get -y install --no-install-recommends \ && apt-get -y install --no-install-recommends \
wget \ wget \
xz-utils \ xz-utils \
&& wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/${sdk_file_name}" \ && cd ${TMP} \
&& sh ${sdk_file_name} --quiet -- -d ${ZEPHYR_SDK_INSTALL_DIR} \ && wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/${minimal_sdk_file_name}.tar.gz" \
&& rm ${sdk_file_name} \ && tar xvfz ${minimal_sdk_file_name}.tar.gz \
&& mv zephyr-sdk-${ZEPHYR_SDK_VERSION} /opt/ \
&& rm ${minimal_sdk_file_name}.tar.gz \
&& cd /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION} \
&& ./setup.sh -h -c -t ${ARCHITECTURE}${arch_sep}zephyr-${arch_format} \
&& cd \
&& apt-get remove -y --purge \ && apt-get remove -y --purge \
wget \ wget \
xz-utils \ xz-utils \

View File

@ -1,15 +1,18 @@
- arc - arc
- arc64
- arm - arm
- arm64 - aarch64
- mips - mips
- nios2 - nios2
- riscv64 - riscv64
- sparc - sparc
- x86_64 - x86_64
- xtensa_intel_apl_adsp - xtensa-espressif_esp32
- xtensa_intel_bdw_adsp - xtensa-espressif_esp32s2
- xtensa_intel_byt_adsp - xtensa-intel_apl_adsp
- xtensa_intel_s1000 - xtensa-intel_bdw_adsp
- xtensa_nxp_imx8m_adsp - xtensa-intel_byt_adsp
- xtensa_nxp_imx_adsp - xtensa-intel_s1000
- xtensa_sample_controller - xtensa-nxp_imx8m_adsp
- xtensa-nxp_imx_adsp
- xtensa-sample_controller