Skip to content

Commit

Permalink
chore: use arm64 runners for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 24, 2025
1 parent f7311fd commit 7aceb5a
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 41 deletions.
110 changes: 96 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,111 @@ jobs:
max_attempts: 3
command: mise run test
dockerhub:
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
tag_suffix: amd64
platform: linux/amd64
- os: ubuntu-24.04-arm
tag_suffix: arm64
platform: linux/arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
run: |
platform="${{ matrix.platform.platform }}"
echo "PLATFORM_PAIR=${platform//\//-}" >> "$GITHUB_ENV"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
jdxcode/mise
ghcr.io/jdx/mise
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: jdxcode
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=jdxcode/mise,ghcr.io/jdx/mise",push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs: [dockerhub]
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: jdxcode
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: jdx
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: jdxcode/mise
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: jdxcode/mise:latest,jdxcode/mise:${{ github.ref_name }}
labels: ${{ steps.meta.outputs.labels }}
images: |
jdxcode/mise
ghcr.io/jdx/mise
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'jdxcode/mise:${{ github.ref_name }}@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/jdx/mise:${{ github.ref_name }}@sha256:%s ' *)
docker buildx imagetools create -t jdxcode/mise:latest \
$(printf 'jdxcode/mise:${{ github.ref_name }}@sha256:%s ' *)
docker buildx imagetools create -t ghcr.io/jdx/mise:latest \
$(printf 'ghcr.io/jdx/mise:${{ github.ref_name }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect jdxcode/mise:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ghcr.io/jdx/mise:${{ steps.meta.outputs.version }}
2 changes: 1 addition & 1 deletion docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli
| esy | [asdf:mise-plugins/mise-esy](https://github.com/mise-plugins/mise-esy) |
| etcd | [aqua:etcd-io/etcd](https://github.com/etcd-io/etcd) [asdf:particledecay/asdf-etcd](https://github.com/particledecay/asdf-etcd) [vfox:mise-plugins/vfox-etcd](https://github.com/mise-plugins/vfox-etcd) |
| evans | [aqua:ktr0731/evans](https://github.com/ktr0731/evans) [asdf:goki90210/asdf-evans](https://github.com/goki90210/asdf-evans) |
| eza | [aqua:eza-community/eza](https://github.com/eza-community/eza) [asdf:mise-plugins/mise-eza](https://github.com/mise-plugins/mise-eza) [cargo:eza](https://crates.io/crates/eza) |
| eza | [asdf:mise-plugins/mise-eza](https://github.com/mise-plugins/mise-eza) [cargo:eza](https://crates.io/crates/eza) |
| fd | [aqua:sharkdp/fd](https://github.com/sharkdp/fd) [ubi:sharkdp/fd](https://github.com/sharkdp/fd) [asdf:https://gitlab.com/wt0f/asdf-fd](https://gitlab.com/wt0f/asdf-fd) |
| ffmpeg | [asdf:mise-plugins/mise-ffmpeg](https://github.com/mise-plugins/mise-ffmpeg) |
| figma-export | [ubi:RedMadRobot/figma-export](https://github.com/RedMadRobot/figma-export) [asdf:younke/asdf-figma-export](https://github.com/younke/asdf-figma-export) |
Expand Down
10 changes: 1 addition & 9 deletions man/man1/mise.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ mise \- The front\-end to your dev env
.SH SYNOPSIS
\fBmise\fR [\fB\-C\fR|\fB\-\-cd\fR] [\fB\-E\fR|\fB\-\-env\fR] [\fB\-j\fR|\fB\-\-jobs\fR] [\fB\-\-output\fR] [\fB\-\-raw\fR] [\fB\-\-no\-config\fR] [\fB\-y\fR|\fB\-\-yes\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-\-silent\fR] [\fB\-v\fR|\fB\-\-verbose\fR]... [\fB\-h\fR|\fB\-\-help\fR] [\fITASK\fR] [\fITASK_ARGS\fR] [\fITASK_ARGS_LAST\fR] [\fIsubcommands\fR]
.SH DESCRIPTION
.PP
mise is a tool for managing runtime versions. https://github.com/jdx/mise
.PP
It\*(Aqs a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc.
that works for any language. It\*(Aqs also great for managing linters/tools like
jq and shellcheck.
.PP
It is inspired by asdf and uses asdf\*(Aqs plugin ecosystem under the hood:
https://asdf\-vm.com/
mise manages dev tools, runs tasks, and managed env vars. https://github.com/jdx/mise
.SH OPTIONS
.TP
\fB\-C\fR, \fB\-\-cd\fR=\fIDIR\fR
Expand Down
7 changes: 2 additions & 5 deletions mise.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[tools.actionlint]
version = "1.7.6"
version = "1.7.7"
backend = "aqua:rhysd/actionlint"

[tools.actionlint.checksums]
actionlint-linux-x86_64 = "sha256:bf567ce887b8b045fdd6001411aea1971e90a49e4f5172801fb648902843c9ec"
actionlint-macos-aarch64 = "sha256:baa69aa6ae140310d9d86127d916abd42cd2ad446aef0a04f2a7fe7f54da7d67"
"actionlint_1.7.6_darwin_arm64.tar.gz" = "sha256:9a7c9cb2b627bb137ef68742eead2dd5b78f3ddc44876e84c37d323ba28b4710"
"actionlint_1.7.6_linux_amd64.tar.gz" = "sha256:5d1a70d9de15fee5371e6f9e20cc29b284e814d6ee1b882f9749e91caf716eba"
"actionlint_1.7.7_darwin_arm64.tar.gz" = "sha256:2693315b9093aeacb4ebd91a993fea54fc215057bf0da2659056b4bc033873db"

[tools.bun]
version = "1.1.44"
Expand Down
2 changes: 1 addition & 1 deletion mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ min_usage_version "1.3"
name mise
bin mise
about "The front-end to your dev env"
long_about "\nmise is a tool for managing runtime versions. https://github.com/jdx/mise\n\nIt's a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc.\nthat works for any language. It's also great for managing linters/tools like\njq and shellcheck.\n\nIt is inspired by asdf and uses asdf's plugin ecosystem under the hood:\nhttps://asdf-vm.com/"
long_about "mise manages dev tools, runs tasks, and managed env vars. https://github.com/jdx/mise"
usage "Usage: mise [OPTIONS] [TASK] [COMMAND]"
flag "-C --cd" help="Change directory before running command" global=#true {
arg <DIR>
Expand Down
3 changes: 3 additions & 0 deletions packaging/mise/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1
FROM rust AS builder
LABEL maintainer="jdx"
LABEL org.opencontainers.image.source=https://github.com/jdx/mise
LABEL org.opencontainers.image.description="mise is a tool for managing your development environment"
LABEL org.opencontainers.image.licenses=MIT

WORKDIR /usr/src/mise
COPY . /usr/src/mise/
Expand Down
11 changes: 2 additions & 9 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,8 @@ impl Cli {
}
}

const LONG_ABOUT: &str = "
mise is a tool for managing runtime versions. https://github.com/jdx/mise
It's a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc.
that works for any language. It's also great for managing linters/tools like
jq and shellcheck.
It is inspired by asdf and uses asdf's plugin ecosystem under the hood:
https://asdf-vm.com/";
const LONG_ABOUT: &str =
"mise manages dev tools, runs tasks, and managed env vars. https://github.com/jdx/mise";

const LONG_TASK_ABOUT: &str = r#"Task to run.
Expand Down
2 changes: 1 addition & 1 deletion xtasks/lint-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ prettier -w $(git ls-files '*.yml' '*.yaml')
prettier -w .
markdownlint --fix .
taplo fmt
SHELLCHECK_OPTS="--exclude=SC1090" actionlint
SHELLCHECK_OPTS="--exclude=SC1090 --exclude=SC2046" actionlint
toml-sort -i settings.toml --spaces-indent-inline-array 4
toml-sort -i registry.toml --spaces-indent-inline-array 4

Expand Down
2 changes: 1 addition & 1 deletion xtasks/lint/actionlint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

export SHELLCHECK_OPTS="--exclude=SC1090"
export SHELLCHECK_OPTS="--exclude=SC1090 --exclude=SC2046"
actionlint

0 comments on commit 7aceb5a

Please sign in to comment.