-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
69 lines (68 loc) · 2.48 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
name: 'ARTIFACT TO UNZIP'
description: 'Download and Unzip an Node Artifact'
inputs:
production:
description: 'Is this a production build?'
required: true
default: 'true'
addIgnore:
description: 'Add Ignore?'
required: true
default: 'true'
ignore:
description: 'Ignore Files'
required: true
default: '/source\n/src\n/database\n'
branch:
description: 'Branch to checkout files from'
required: true
default: main
runs:
using: "composite"
steps:
- name: Download a package
uses: Bhacaz/checkout-files@master
with:
files: package.json
token: ${{ github.token }}
branch: ${{ inputs.branch }}
- name: GET VERSION
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: 'Set Production:'
run: echo "PROD=$(${{ inputs.production == 'true' }} && echo '' || echo '-s')" >> $GITHUB_ENV
shell: bash
- name: Download a single artifact
if: ${{ github.event.workflow_run.workflow_id }}
uses: dawidd6/action-download-artifact@master
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
- name: Download a single artifact
if: ${{ !github.event.workflow_run.workflow_id }}
uses: actions/download-artifact@main
with:
path: ${{ steps.package-version.outputs.current-version }}${{ env.PROD }}/${{ steps.package-version.outputs.current-version }}${{ env.PROD }}.zip
- name: Add Ignore
if: ${{ inputs.addIgnore == 'true' }}
run: echo -e '${{ steps.package-version.outputs.current-version }}*\n${{ inputs.ignore }}' >> .npmignore
shell: bash
- name: Print
run: ls
shell: bash
- name: Print ${{ steps.package-version.outputs.current-version }}
run: ls ${{ steps.package-version.outputs.current-version }}
shell: bash
- name: Extract some files
uses: DuckSoft/extract-7z-action@master
with:
pathSource: "${{ steps.package-version.outputs.current-version }}${{ env.PROD }}/${{ steps.package-version.outputs.current-version }}${{ env.PROD }}.zip"
pathTarget: "."
recursive: false
# run: 7z x ${{ steps.package-version.outputs.current-version }}${{ env.PROD }}/${{ steps.package-version.outputs.current-version }}${{ env.PROD }}.zip -aoa
# shell: bash
- name: Print end
run: ls
shell: bash
- name: Print ${{ steps.package-version.outputs.current-version }} end
run: ls ${{ steps.package-version.outputs.current-version }}
shell: bash