Skip to content

ci: update release-please #256

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

Merged
merged 3 commits into from
May 27, 2024
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
72 changes: 72 additions & 0 deletions .github/.release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"release-type": "php",
"packages": {
".": {
"package-name": "laravel-open-docs",
"changelog-path": "/CHANGELOG.md"
}
},
"include-component-in-tag": false,
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "deps",
"section": "Dependencies",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "revert",
"section": "Reverts",
"hidden": true
}
]
}
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.0.108"
}
13 changes: 0 additions & 13 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

21 changes: 13 additions & 8 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
# this file is for the labeler workflow job
# Documentation https://github.com/marketplace/actions/labeler

'type: documentation':
- assets/**/*
- .github/*
- ./*.md

'type: maintenance':
- .github/**/*
- tests/**/*
"type: bug":
- head-branch: ['^bug', '^fix', 'bug', 'fix']

"type: enhancement":
- head-branch: ['^feature', '^feat', 'feature']

"type: documentation":
- changed-files:
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']

"type: maintenance":
- changed-files:
- any-glob-to-any-file: ['tests/**/*', '.github/workflows/*']

...
2 changes: 1 addition & 1 deletion .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: 🏷️ Add labels

jobs:
label:
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@v3.1.0
with:
os: ubuntu-latest
secrets:
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
# https://github.com/google-github-actions/release-please-action#release-types-supported
# https://github.com/googleapis/release-please/blob/main/docs/customizing.md

on: # yamllint disable-line rule:truthy
push:
Expand All @@ -12,12 +13,15 @@ name: 📦 Create release

jobs:
release:
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
with:
os: ubuntu-latest
branch: master
package-name: laravel-open-docs
secrets:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: 🎉 Create release
uses: googleapis/release-please-action@v4.1.1
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
config-file: .github/.release-please-config.json
manifest-file: .github/.release-please-manifest.json
target-branch: master

...
6 changes: 0 additions & 6 deletions package.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/Bridge/Laravel/Console/Commands/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function handle(ConfigRepository $config): int
$collection = $this->argument('collection');
$collectionExists = $config->collections()->has($collection);

if (false === $collectionExists) {
if ($collectionExists === false) {
$this->error('Collection "' . $collection . '" does not exist.');

return self::FAILURE;
Expand Down
23 changes: 12 additions & 11 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,26 @@ final class Config implements ConfigRepository
];

private readonly bool $onFly;

private readonly array $frontend;

private readonly Collection $collections;

public function __construct(
bool $onFly,
array $frontend,
array $collections,
) {
$this->onFly = $onFly;
$this->frontend = $frontend;
$this->collections = new Collection($collections);
}

public static function fromArray(array $config): self
{
$missingAttributes = array_diff(self::REQUIRED_FIELDS, array_keys($config));

if ([] !== $missingAttributes) {
if ($missingAttributes !== []) {
throw MissingRequiredAttributes::fromArray(
implode(',', $missingAttributes)
);
Expand All @@ -42,16 +53,6 @@ public static function fromArray(array $config): self
);
}

public function __construct(
bool $onFly,
array $frontend,
array $collections,
) {
$this->onFly = $onFly;
$this->frontend = $frontend;
$this->collections = new Collection($collections);
}

public function onFly(): bool
{
return $this->onFly;
Expand Down
Loading