Skip to content

Commit

Permalink
fix: use dart service account for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Mar 24, 2024
1 parent e234cae commit 2d10e98
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
publish:
docker:
- image: oryd/sdk:v0.0.52
- image: oryd/sdk:v0.0.53
working_directory: /sdk
steps:
- checkout
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
# the following is a workaround for openjdk-11-jre-headless erroring due to not having a man path in slim-debian
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi-dev libssl-dev php composer php-curl php-dom php-xml php-simplexml php-xmlwriter maven pkg-config twine
RUN apt-get install -y --no-install-recommends python3 python3-dev python3-pip ruby jq gnupg git gettext libffi-dev libssl-dev php composer php-curl php-dom php-xml php-simplexml php-xmlwriter maven pkg-config twine sudo apt-transport-https
# RUN apk add -U --no-cache ca-certificates bash nodejs npm python3 python3-dev py-pip ruby jq build-base gnupg git openssh curl gettext libffi libffi-dev openssl-dev php composer php-curl php7-tokenizer wget php-dom php-xml php-simplexml php-xmlwriter maven

RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN sudo apt-get update && sudo apt-get install google-cloud-cli

# https://stackoverflow.com/questions/35736598/cannot-pip-install-cryptography-in-docker-alpine-linux-3-3-with-openssl-1-0-2g
#RUN apk add --no-cache \
# libressl-dev \
Expand Down Expand Up @@ -124,4 +128,3 @@ RUN go build -o /usr/local/bin/ory github.com/ory/cli

RUN swagger version
RUN ory version

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ You may also manually build and publish this image using:

```shell script
docker build --platform linux/amd64 -t oryd/sdk:latest .
docker tag oryd/sdk:latest oryd/sdk:v0.0.51
docker push oryd/sdk:v0.0.51
docker tag oryd/sdk:latest oryd/sdk:v0.0.53
docker push oryd/sdk:v0.0.53
```

## Running the Image Locally
Expand Down
28 changes: 10 additions & 18 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,16 @@ dotnet() {

dart() {
dir="clients/${PROJECT}/dart"

# mkdir -p ~/.pub-cache || true
# set +x
# cat <<EOF > ~/.pub-cache/credentials.json
# {
# "accessToken":"${DART_ACCESS_TOKEN}",
# "refreshToken":"${DART_REFRESH_TOKEN}",
# "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
# "scopes": [
# "openid",
# "https://www.googleapis.com/auth/userinfo.email"
# ],
# "expiration": 1611594593613
# }
# EOF
# set -x

# (cd "${dir}"; VERSION=${RAW_VERSION} command dart pub publish --force)
mkdir -p ~/.pub-cache || true
set +x
echo "$DART_SERVICE_ACCOUNT" | base64 -d > ~/.pub-cache/key-file.json
gcloud auth activate-service-account --key-file=~/.pub-cache/key-file.json
gcloud auth print-identity-token \
--audiences=https://pub.dev \
| dart pub token add https://pub.dev
set -x

(cd "${dir}"; VERSION=${RAW_VERSION} command dart pub publish --force)
to_git "dart" "yes"
}

Expand Down

0 comments on commit 2d10e98

Please sign in to comment.