forked from dev-this/satis-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 94b167e
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Satis - composer repository | ||
Used for building your own composer repository using [composer/satis](https://github.com/composer/satis). | ||
|
||
## Inputs | ||
|
||
| Input | Description | Required | | ||
|--------------|---------------------------------------------------------------------------------------------------------|------------------------------| | ||
| token | GitHub token that will be used for composer when invoked by satis.<br/>Currently auth is static for "github-oauth" | Yes | | ||
| satis_config | Path to your satis configuration file | No.<br/>Default = `./satis.json` | | ||
|
||
## Outputs | ||
None | ||
|
||
## Usage | ||
**Note:** Your `satis.json` **must** contain `"output-dir": ""` | ||
|
||
Example `.github/workflow/composer-build.yaml` | ||
```yaml | ||
# eg. Can be used to host your internal composer package registry on github pages. | ||
name: Composer repository | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dev-this/satis-build@v1 | ||
with: | ||
token: ${{ GITHUB_TOKEN }} # App/OAuth token, PAT | ||
- env: | ||
GIT_EMAIL: [email protected] | ||
GIT_NAME: cool-bot | ||
run: | | ||
git config user.name $GIT_NAME | ||
git config user.email $GIT_EMAIL | ||
git add docs/ | ||
git commit -m "Re-built repository assets" | ||
git push | ||
``` | ||
Example `satis.json` | ||
```json | ||
{ | ||
"name": "my-cool/repository", | ||
"homepage": "https://where-are-you/", | ||
"repositories": [ | ||
{ | ||
"packagist.org": false | ||
}, | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/my-cool-org/the-repository" | ||
} | ||
], | ||
"require-all": true, | ||
"output-dir": "docs" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Satis build - composer repository' | ||
description: 'Build a static composer repository using satis' | ||
|
||
inputs: | ||
token: | ||
description: 'Token to use (ie. GITHUB_TOKEN, App token or a PAT)' | ||
required: true | ||
satis_config: | ||
description: 'Path to satis configuration file (default: ./satis.json)' | ||
required: false | ||
default: 'satis.json' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- env: | ||
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ inputs.token }}"}}' | ||
run: | | ||
echo '{"require": {"composer/satis": "dev-main"}}' > composer.json | ||
composer require composer/satis --prefer-dist \ | ||
--no-progress --no-interaction -o \ | ||
--ignore-platform-reqs | ||
php vendor/bin/satis build ${{ inputs.satis_config }} -n | ||
shell: bash | ||
|
||
branding: | ||
icon: 'download-cloud' | ||
color: 'gray-dark' |