mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
add 'composite' version of the Action
This commit is contained in:
58
.github/workflows/test.yml
vendored
58
.github/workflows/test.yml
vendored
@@ -72,3 +72,61 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/**
|
||||
|
||||
|
||||
test-composite:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||
|
||||
- name: Single
|
||||
uses: ./composite
|
||||
with:
|
||||
rm: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifact-*.txt
|
||||
|
||||
- name: List
|
||||
uses: ./composite
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: |
|
||||
artifact-*.txt
|
||||
README.md
|
||||
|
||||
- name: Add artifacts/*.txt
|
||||
run: |
|
||||
mkdir artifacts
|
||||
echo "Build some tool and generate some artifacts" > artifacts/artifact.txt
|
||||
touch artifacts/empty_file.txt
|
||||
|
||||
- name: Single in subdir
|
||||
uses: ./composite
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/artifact.txt
|
||||
|
||||
- name: Add artifacts/*.md
|
||||
run: |
|
||||
echo "tip hello" > artifacts/hello.md
|
||||
echo "tip world" > artifacts/world.md
|
||||
|
||||
- name: Directory wildcard
|
||||
uses: ./composite
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/*
|
||||
|
||||
- name: Add artifacts/subdir
|
||||
run: |
|
||||
mkdir artifacts/subdir
|
||||
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||
|
||||
- name: Directory wildcard (recursive)
|
||||
uses: ./composite
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: artifacts/**
|
||||
|
||||
30
composite/action.yml
Normal file
30
composite/action.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
name: 'tip'
|
||||
description: "keep a pre-release always up-to-date"
|
||||
inputs:
|
||||
token:
|
||||
description: 'Token to make authenticated API calls; can be passed in using {{ secrets.GITHUB_TOKEN }}'
|
||||
required: true
|
||||
files:
|
||||
description: 'Multi-line list of glob patterns describing the artifacts to be uploaded'
|
||||
required: true
|
||||
tag:
|
||||
description: 'Name of the tag that corresponds to the tip/nightly pre-release'
|
||||
required: false
|
||||
default: tip
|
||||
rm:
|
||||
description: 'Whether to delete all the previous artifacts, or only replacing the ones with the same name'
|
||||
required: false
|
||||
default: false
|
||||
snapshots:
|
||||
description: 'Whether to create releases from any tag or to treat some as snapshots'
|
||||
required: false
|
||||
default: true
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
|
||||
- shell: bash
|
||||
run: pip install PyGithub --progress-bar off
|
||||
|
||||
- shell: bash
|
||||
run: ${{ github.action_path }}/../tip.py
|
||||
Reference in New Issue
Block a user