-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: image was found but does not match the specified platform #748
Comments
Could you please run |
|
How does your |
P.S. you probably want to use |
This is my .cirrus.starload(
"./cirrus/common.star",
"secrets",
"setup_1password_cli",
"setup_credentials",
"setup_fastlane",
)
load("cirrus", "fs", "yaml")
load(
"github.com/cirrus-modules/helpers",
"cache",
"container",
"macos_instance",
"script",
"task",
)
def main():
pubspec = fs.read("pubspec.yaml")
flutter_version = yaml.loads(pubspec)["environment"]["flutter"]
return [
task(
name = "Deploy Android app",
env = {"CIRRUS_CLONE_TAGS": "true"} | secrets(),
instance = container(
image = "ghcr.io/cirruslabs/flutter:%s" % flutter_version,
),
only_if = "$CIRRUS_TAG =~ 'v.*' || $CIRRUS_BRANCH == 'master'",
instructions = [
cache("pub", "~/.pub-cache"),
setup_1password_cli(),
setup_credentials(),
setup_fastlane(),
script(
"fastlane_android_distribute",
"cd android",
"""\
if [ "$CIRRUS_TAG" == "v*" ]; then
op run -- bundle exec fastlane android internal
else
op run -- bundle exec fastlane android distribute
fi
""",
),
],
),
task(
name = "Deploy iOS app",
env = {"CIRRUS_CLONE_TAGS": "true"} | secrets(),
instance = macos_instance(
image = "ghcr.io/cirruslabs/macos-runner:sonoma",
),
only_if = "$CIRRUS_TAG =~ 'v.*' || $CIRRUS_BRANCH == 'master'",
instructions = [
cache("cocoapods", "~/.cocoapods"),
setup_1password_cli(),
setup_credentials(),
setup_fastlane(),
script(
"fastlane_ios_distribute",
"cd ios",
"""\
if [ "$CIRRUS_TAG" == "v*" ]; then
op run -- bundle exec fastlane ios prod
else
op run -- bundle exec fastlane ios distribute
fi
""",
),
],
),
] It references ./cirrus/common.starload("github.com/cirrus-modules/helpers", "script")
def secrets():
return {
"OP_SERVICE_ACCOUNT_TOKEN": "ENCRYPTED[6cb47a274401075b0883b77c85a850631b342ec26afc074cc1bf679b6fd18d2ae81e53bde62b2fde49a89374271e82fa]",
}
def setup_credentials():
return script(
"setup_credentials",
"""\
if [ $(uname) = \"Linux\" ]; then
apt-get update && apt-get install -y jq
fi
""",
"chmod +x ./setup_credentials && ./setup_credentials",
'while read -r line; do echo "$line" >> $CIRRUS_ENV; done < .env',
)
def setup_1password_cli():
return script(
"setup_1password_cli",
"""\
if [ $(uname) = \"Linux\" ]; then
apt-get update && apt-get install -y jq
%s
elif [ $(uname) = \"Darwin\" ]; then
%s
fi
""" % (_setup_1password_cli_debian, _setup_1password_cli_macos),
"echo \"OP_SERVICE_ACCOUNT_KEY: $OP_SERVICE_ACCOUNT_KEY\"",
)
_setup_1password_cli_debian = """\
# Add key for 1Password APT repository
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
# Add the 1Password apt repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | sudo tee /etc/apt/sources.list.d/1password.list
#Add the debsig-verify policy
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg
# Install 1Password CLI
apt-get update && apt-get install -y 1password-cli"""
_setup_1password_cli_macos = """\
brew install 1password-cli"""
def setup_fastlane():
return script(
"setup_fastlane",
"gem install bundler",
"cd android && bundle install",
"cd ..",
"cd ios && bundle install",
) |
@edigaryev Using |
Do I understand correctly that the only issue remaining is that this
Causes your What does your |
No, the issue is that when I try to run the image, it throws the error from OP. Logs
|
Weirdly, everything seems to work just fine now. I think the most productive thing to do is to close this issue. If I encounter the problem again, I'll create a fully reproducible example. Thanks for all the help. |
My environment
In my project, I'm in the process of migrating to
ghcr.io/cirruslabs/macos-runner:sonoma
. However, when I run the workflow, I always get:This was not occuring before. FWIW, a similar problem also occurs with Linux containers
The text was updated successfully, but these errors were encountered: