-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
76 lines (76 loc) · 2.54 KB
/
action.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "Continuous Delivery and Continuous Deployment Package Convention"
description: "Trip Teknologi's Continuous Delivery and Continuous Deployment Package Convention"
author: "Trip Teknologi"
inputs:
token:
required: true
description: "Token"
repotoken:
required: true
description: "Repository Token"
repouser:
required: true
description: "Repository User"
repository:
required: true
description: "Repository Address"
language:
required: true
description: "Target of Language Artifact"
artifact:
required: true
description: "Target of Version Artifact"
outputs:
version:
value: ${{ steps.version.outputs.version }}
description: "Version of Artifact"
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: version
uses: tripteki/[email protected]
with:
token: ${{ inputs.token }}
artifact: ${{ inputs.artifact }}
- id: php
if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'php' }}
shell: sh
run: |
package ()
{
event=$1
curl -v -H "Content-Type: application/json" -X POST "https://packagist.org/api/$event-package?"'username='${{ inputs.repouser }}'&apiToken='${{ inputs.repotoken }} -d '{"repository":{"url":"'${{ github.repositoryUrl }}'"}}'
}
package create
package update
- if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'js' }}
uses: actions/setup-node@v3
with:
node-version: "16"
- if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'js' }}
shell: sh
run: npm install
- id: js
if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'js' }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ inputs.repotoken }}
registry: ${{ inputs.repository }}
- if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'py' }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'py' }}
shell: sh
run: python -m pip install build --user && python -m build --sdist --wheel --outdir dist/
- id: py
if: ${{ steps.version.outputs.passes == 'true' && inputs.language == 'py' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ inputs.repouser }}
password: ${{ inputs.repotoken }}
repository_url: ${{ inputs.repository }}
verbose: true