-
Notifications
You must be signed in to change notification settings - Fork 38
85 lines (73 loc) · 2.05 KB
/
ci.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
77
78
79
80
81
82
83
84
85
name: "Build and Test"
on:
# Trigger manually
workflow_dispatch:
pull_request:
push:
tags:
- "*"
branches:
- main
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup node and cache dependencies
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Build and test
shell: bash
run: |
npm ci
npm run all
- name: Run action
uses: ./
id: download-public
with:
repository: "robinraju/probable-potato"
tag: "1.0.1"
fileName: "potato.jpeg"
tarBall: true
zipBall: true
out-file-path: "./test-downloads"
- name: List downloaded files
shell: bash
run: ls -lrth test-downloads
- name: Test download from a private repo
uses: ./
id: download-private
with:
repository: "robinraju/release-downloader-test"
latest: true
fileName: "*"
tarBall: true
zipBall: true
extract: true
token: ${{ secrets.RELEASE_DOWNLOADER_TEST_TOKEN }}
out-file-path: "./downloader-test"
- name: List downloaded files from private repo
shell: bash
run: ls -lrth downloader-test
- name: Read output variable set by previous steps
shell: bash
run: |
if [ -n ${{steps.download-public.outputs.tag_name}} ]; then
echo ${{steps.download-public.outputs.tag_name}}
else echo "Unable to read output variable from step download-public"; exit 1
fi
if [ -n ${{steps.download-private.outputs.tag_name}} ]; then
echo ${{steps.download-private.outputs.tag_name}}
else echo "Unable to read output variable from step download-private"; exit 1
fi
echo "Downloaded files:"
echo ${{steps.download-public.outputs.downloaded_files}}