Skip to content
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

💚 Fix CI publish #419

Merged
merged 9 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 38 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,58 @@ name: Publish packages

on:
push:
branches: ['master']
branches:
- master
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
permissions: read-all

jobs:
publish_chopper:
name: "Publish chopper"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1.3
name: "Publish chopper"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: credentials
run: |
mkdir -p $XDG_CONFIG_HOME/dart
echo '${{ secrets.PUB_CREDENTIALS }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- id: publish
run: bash tool/publish.sh chopper
env:
CREDENTIAL_JSON: ${{ secrets.CREDENTIAL_JSON }}
publish_chopper_generator:
name: "Publish chopper_generator"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: publish
run: bash tool/publish.sh chopper_generator
env:
CREDENTIAL_JSON: ${{ secrets.CREDENTIAL_JSON }}
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: credentials
run: |
mkdir -p $XDG_CONFIG_HOME/dart
echo '${{ secrets.PUB_CREDENTIALS }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- id: publish
run: bash tool/publish.sh chopper_generator
publish_chopper_built_value:
name: "Publish chopper_built_value"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1.3
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: publish
run: bash tool/publish.sh chopper_built_value
env:
CREDENTIAL_JSON: ${{ secrets.CREDENTIAL_JSON }}
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: credentials
run: |
mkdir -p $XDG_CONFIG_HOME/dart
echo '${{ secrets.PUB_CREDENTIALS }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- id: publish
run: bash tool/publish.sh chopper_built_value
47 changes: 47 additions & 0 deletions .github/workflows/publish_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish packages (dry run)

on:
pull_request:
branches:
- master
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
permissions: read-all

jobs:
publish_chopper:
name: "Publish chopper (dry run)"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: publish_dry_run
run: bash tool/publish.sh chopper --dry-run
publish_chopper_generator:
name: "Publish chopper_generator (dry run)"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: publish_dry_run
run: bash tool/publish.sh chopper_generator --dry-run
publish_chopper_built_value:
name: "Publish chopper_built_value (dry run)"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@v1
with:
sdk: stable
- id: checkout
uses: actions/checkout@v3
- id: publish_dry_run
run: bash tool/publish.sh chopper_built_value --dry-run
Binary file removed chopper/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions chopper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Changelog

## 6.1.2
- Packages upgrade, constraints upgrade

## 6.1.1
- EquatableMixin for Request, Response and PartValue

## 6.1.0

- HttpLogging interceptor more configurable
- Apply headers field name case insensitive.

## 6.0.0

- Replaced the String based path with Uri (BREAKING CHANGE)
Expand Down
8 changes: 8 additions & 0 deletions chopper_built_value/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.1

- Packages upgrade, constraints upgrade

## 1.2.0

- Chopper upgraded

## 1.1.0

- Chopper upgraded
Expand Down
4 changes: 4 additions & 0 deletions chopper_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.0.1

- Packages upgrade, constraints upgrade

## 6.0.0

- Replaced the String based path with Uri (BREAKING CHANGE)
Expand Down
11 changes: 6 additions & 5 deletions tool/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ PKG=$1
echo -e "\033[1mPKG: ${PKG}\033[22m"
pushd "${PKG}"

mkdir -p ~/.pub-cache

echo $CREDENTIAL_JSON > ~/.pub-cache/credentials.json

sed '/Comment before publish$/,+2 d' pubspec.yaml > pubspec.temp.yaml
rm pubspec.yaml
mv pubspec.temp.yaml pubspec.yaml

dart pub publish -f
if [ "$2" == "--dry-run" ]; then
dart pub publish --dry-run
else
dart pub publish --force
fi

popd