forked from dev-this/satis-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
42 lines (34 loc) · 1.19 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 }}"}}'
COMPOSER_HOME: /tmp/.satis-build
run: |
mkdir /tmp/.satis-build
echo "{}" > /tmp/.satis-build/composer.json
composer g config allow-plugins.composer/satis true
composer g require composer/satis:dev-main --prefer-dist \
--no-cache --no-progress --no-interaction -o \
--ignore-platform-reqs
php $COMPOSER_HOME/vendor/bin/satis build ${{ inputs.satis_config }} -n
if cat ${{ inputs.satis_config }} | jq .archive -e; then
php $COMPOSER_HOME/vendor/bin/satis purge ${{ inputs.satis_config }} -n
fi
shell: bash
- run: |
rm -rf $COMPOSER_HOME
shell: bash
branding:
icon: 'download-cloud'
color: 'gray-dark'