Skip to content

Commit

Permalink
chore(ci/nightly): build arm64 on M1 macOS runner
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Mar 16, 2024
1 parent e424251 commit a25175e
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.PNPM_STORE_PATH }}
Expand Down Expand Up @@ -130,6 +130,7 @@ jobs:
platform:
- linux/amd64
- linux/arm64
- linux/arm/v7
# exclude:
# # exclude build x86 on arm, and vice versa.
# - { os: macos-14, platform: linux/amd64 }
Expand Down Expand Up @@ -182,9 +183,12 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ env.DOCKER_BUILD_ARGS }}
# The `type=image,push=true` must the last one,
# because the `build.outputs.digest` will output the last image's digest.
# The digests will be used in the merge step.
outputs: |
type=image,push=true,name=${{ env.DOCKER_IMG }},push-by-digest=true,name-canonical=true
type=docker,name=${{ env.DOCKER_IMG }}
type=image,push=true,name=${{ env.DOCKER_IMG }},push-by-digest=true,name-canonical=true
- name: Export digest
run: |
Expand Down Expand Up @@ -275,8 +279,10 @@ jobs:
- name: Create manifest list and push
working-directory: ${{ env.DIGEST_DIR }}
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.DOCKER_IMG }}@sha256:%s ' *)
TAGS_ARG=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
MINIFEST_SRCS=$(printf '${{ env.DOCKER_IMG }}@sha256:%s ' *)
docker buildx imagetools create ${TAGS_ARG} ${MINIFEST_SRCS}
- name: Inspect image
run: |
Expand Down Expand Up @@ -307,9 +313,13 @@ jobs:
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
CHANGELOG=$(git-chglog --config .github/chglog/config.yml --next-tag nightly nightly)
echo -e "$CHANGELOG" > /tmp/changelog.md
echo -e "\n> ⚠️ This version is latest nightly build and is **NOT** the final released version. Please use it with caution." \
"\n> 💡 Docker user can run \`docker pull artalk/artalk-go:nightly\` to get the nightly build." >> release.md
MD_FILE="/tmp/changelog.md"
echo -e "$CHANGELOG" > $MD_FILE
echo -e "\n> [!NOTE]\n" \
"> The Nightly version, automatically built based on the latest code, " \
"is not yet released and may be unstable. Please use it with caution. " \
"Docker user can run \`docker pull artalk/artalk-go:nightly\` to get " \
"the nightly build." >> $MD_FILE
- name: Get release files
run: |
Expand Down

0 comments on commit a25175e

Please sign in to comment.