mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
rename 'tip' to 'releaser'
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Tip
|
name: Test Releaser
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -25,14 +25,14 @@ jobs:
|
|||||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||||
|
|
||||||
- name: Single
|
- name: Single
|
||||||
uses: ./tip
|
uses: ./releaser
|
||||||
with:
|
with:
|
||||||
rm: true
|
rm: true
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifact-*.txt
|
files: artifact-*.txt
|
||||||
|
|
||||||
- name: List
|
- name: List
|
||||||
uses: ./tip
|
uses: ./releaser
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: |
|
files: |
|
||||||
@@ -46,18 +46,18 @@ jobs:
|
|||||||
touch artifacts/empty_file.txt
|
touch artifacts/empty_file.txt
|
||||||
|
|
||||||
- name: Single in subdir
|
- name: Single in subdir
|
||||||
uses: ./tip
|
uses: ./releaser
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/artifact.txt
|
files: artifacts/artifact.txt
|
||||||
|
|
||||||
- name: Add artifacts/*.md
|
- name: Add artifacts/*.md
|
||||||
run: |
|
run: |
|
||||||
echo "tip hello" > artifacts/hello.md
|
echo "releaser hello" > artifacts/hello.md
|
||||||
echo "tip world" > artifacts/world.md
|
echo "releaser world" > artifacts/world.md
|
||||||
|
|
||||||
- name: Directory wildcard
|
- name: Directory wildcard
|
||||||
uses: ./tip
|
uses: ./releaser
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/*
|
files: artifacts/*
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||||
|
|
||||||
- name: Directory wildcard (recursive)
|
- name: Directory wildcard (recursive)
|
||||||
uses: ./tip
|
uses: ./releaser
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/**
|
files: artifacts/**
|
||||||
@@ -83,14 +83,14 @@ jobs:
|
|||||||
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
- run: echo "Build some tool and generate some (versioned) artifacts" > artifact-$(date -u +"%Y-%m-%dT%H-%M-%SZ").txt
|
||||||
|
|
||||||
- name: Single
|
- name: Single
|
||||||
uses: ./tip/composite
|
uses: ./releaser/composite
|
||||||
with:
|
with:
|
||||||
rm: true
|
rm: true
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifact-*.txt
|
files: artifact-*.txt
|
||||||
|
|
||||||
- name: List
|
- name: List
|
||||||
uses: ./tip/composite
|
uses: ./releaser/composite
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: |
|
files: |
|
||||||
@@ -104,18 +104,18 @@ jobs:
|
|||||||
touch artifacts/empty_file.txt
|
touch artifacts/empty_file.txt
|
||||||
|
|
||||||
- name: Single in subdir
|
- name: Single in subdir
|
||||||
uses: ./tip/composite
|
uses: ./releaser/composite
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/artifact.txt
|
files: artifacts/artifact.txt
|
||||||
|
|
||||||
- name: Add artifacts/*.md
|
- name: Add artifacts/*.md
|
||||||
run: |
|
run: |
|
||||||
echo "tip hello" > artifacts/hello.md
|
echo "releaser hello" > artifacts/hello.md
|
||||||
echo "tip world" > artifacts/world.md
|
echo "releaser world" > artifacts/world.md
|
||||||
|
|
||||||
- name: Directory wildcard
|
- name: Directory wildcard
|
||||||
uses: ./tip/composite
|
uses: ./releaser/composite
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/*
|
files: artifacts/*
|
||||||
@@ -126,7 +126,7 @@ jobs:
|
|||||||
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
echo "Test recursive glob" > artifacts/subdir/deep_file.txt
|
||||||
|
|
||||||
- name: Directory wildcard (recursive)
|
- name: Directory wildcard (recursive)
|
||||||
uses: ./tip/composite
|
uses: ./releaser/composite
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: artifacts/**
|
files: artifacts/**
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.9-slim-bullseye
|
FROM python:3.9-slim-bullseye
|
||||||
COPY tip.py /tip.py
|
COPY releaser.py /releaser.py
|
||||||
RUN pip install PyGithub --progress-bar off
|
RUN pip install PyGithub --progress-bar off
|
||||||
CMD ["/tip.py"]
|
CMD ["/releaser.py"]
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Tip
|
# Releaser
|
||||||
|
|
||||||
**Tip** is a Docker GitHub Action written in Python.
|
**Releaser** is a Docker GitHub Action written in Python.
|
||||||
|
|
||||||
**Tip** allows to keep a GitHub Release of type pre-release and its artifacts up to date with latest builds.
|
**Releaser** allows to keep a GitHub Release of type pre-release and its artifacts up to date with latest builds.
|
||||||
Combined with a workflow that is executed periodically, **Tip** allows to provide a fixed release name for users willing
|
Combined with a workflow that is executed periodically, **Releaser** allows to provide a fixed release name for users willing
|
||||||
to use daily/nightly artifacts of a project.
|
to use daily/nightly artifacts of a project.
|
||||||
|
|
||||||
Furthermore, when any [semver](https://semver.org) compilant tagged commit is pushed, **Tip** can create a release and
|
Furthermore, when any [semver](https://semver.org) compilant tagged commit is pushed, **Releaser** can create a release and
|
||||||
upload assets.
|
upload assets.
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
@@ -30,9 +30,9 @@ From a practical point of view, [actions/github-script](https://github.com/actio
|
|||||||
Still, it requires writing plain JavaScript.
|
Still, it requires writing plain JavaScript.
|
||||||
|
|
||||||
Alternatively, there are non-official GitHub API libraries available in other languages (see [docs.github.com: rest/overview/libraries](https://docs.github.com/en/rest/overview/libraries)).
|
Alternatively, there are non-official GitHub API libraries available in other languages (see [docs.github.com: rest/overview/libraries](https://docs.github.com/en/rest/overview/libraries)).
|
||||||
**Tip** is based on [PyGithub/PyGithub](https://github.com/PyGithub/PyGithub), a Python client for the GitHub API.
|
**Releaser** is based on [PyGithub/PyGithub](https://github.com/PyGithub/PyGithub), a Python client for the GitHub API.
|
||||||
|
|
||||||
**Tip** was originally created in [eine/tip](https://github.com/eine/tip), as an enhanced alternative to using
|
**Releaser** was originally created in [eine/tip](https://github.com/eine/tip), as an enhanced alternative to using
|
||||||
`actions/create-release` and `actions/upload-release-asset`, in order to cover certain use cases that were being
|
`actions/create-release` and `actions/upload-release-asset`, in order to cover certain use cases that were being
|
||||||
migrated from Travis CI to GitHub Actions.
|
migrated from Travis CI to GitHub Actions.
|
||||||
The main limitation of GitHub's Actions was/is verbosity and not being possible to dynamically define the list of assets
|
The main limitation of GitHub's Actions was/is verbosity and not being possible to dynamically define the list of assets
|
||||||
@@ -42,7 +42,7 @@ On the other hand, GitHub Actions artifacts do require login in order to downloa
|
|||||||
Conversely, assets of GitHub Releases can be downloaded without login.
|
Conversely, assets of GitHub Releases can be downloaded without login.
|
||||||
Therefore, in order to make CI results available to the widest audience, some projects prefer having tarballs available
|
Therefore, in order to make CI results available to the widest audience, some projects prefer having tarballs available
|
||||||
as assets.
|
as assets.
|
||||||
In this context, one of the main use cases of **Tip** is pushing artifacts as release assets.
|
In this context, one of the main use cases of **Releaser** is pushing artifacts as release assets.
|
||||||
Thus, the name of the Action.
|
Thus, the name of the Action.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -72,7 +72,7 @@ jobs:
|
|||||||
# Update tag and pre-release
|
# Update tag and pre-release
|
||||||
# - Update (force-push) tag to the commit that is used in the workflow.
|
# - Update (force-push) tag to the commit that is used in the workflow.
|
||||||
# - Upload artifacts defined by the user.
|
# - Upload artifacts defined by the user.
|
||||||
- uses: pyTooling/Actions/tip@main
|
- uses: pyTooling/Actions/releaser@main
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: |
|
files: |
|
||||||
@@ -82,11 +82,11 @@ jobs:
|
|||||||
|
|
||||||
### Composite Action
|
### Composite Action
|
||||||
|
|
||||||
The default implementation of **Tip** is a Container Action.
|
The default implementation of **Releaser** is a Container Action.
|
||||||
Therefore, in each run, the container image is built before starting the job.
|
Therefore, in each run, the container image is built before starting the job.
|
||||||
Alternatively, a Composite Action version is available: `uses: pyTooling/Actions/tip/composite@main`.
|
Alternatively, a Composite Action version is available: `uses: pyTooling/Actions/releaser/composite@main`.
|
||||||
The Composite version installs the dependencies on the host (the runner environment), instead of using a container.
|
The Composite version installs the dependencies on the host (the runner environment), instead of using a container.
|
||||||
Both implementations are functionally equivalent from **Tip**'s point of view; however, the Composite Action allows users
|
Both implementations are functionally equivalent from **Releaser**'s point of view; however, the Composite Action allows users
|
||||||
to tweak the version of Python by using [actions/setup-python](https://github.com/actions/setup-python) before.
|
to tweak the version of Python by using [actions/setup-python](https://github.com/actions/setup-python) before.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
@@ -117,10 +117,10 @@ Whether to create releases from any tag or to treat some as snapshots. By defaul
|
|||||||
|
|
||||||
## Advanced/complex use cases
|
## Advanced/complex use cases
|
||||||
|
|
||||||
**Tip** is essentially a very fine wrapper to use the GitHub Actions context data along with the classes
|
**Releaser** is essentially a very fine wrapper to use the GitHub Actions context data along with the classes
|
||||||
and methods of PyGithub.
|
and methods of PyGithub.
|
||||||
|
|
||||||
Similarly to [actions/github-script](https://github.com/actions/github-script), users with advanced/complex requirements might find it desirable to write their own Python script, instead of using **Tip**.
|
Similarly to [actions/github-script](https://github.com/actions/github-script), users with advanced/complex requirements might find it desirable to write their own Python script, instead of using **Releaser**.
|
||||||
In fact, since `shell: python` is supported in GitHub Actions, using Python does *not* require any Action.
|
In fact, since `shell: python` is supported in GitHub Actions, using Python does *not* require any Action.
|
||||||
For prototyping purposes, the following job might be useful:
|
For prototyping purposes, the following job might be useful:
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: 'tip'
|
name: 'Releaser'
|
||||||
description: "keep a pre-release always up-to-date"
|
description: 'Publish releases, upload assets and update tip/nightly tags'
|
||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
description: 'Token to make authenticated API calls; can be passed in using {{ secrets.GITHUB_TOKEN }}'
|
description: 'Token to make authenticated API calls; can be passed in using {{ secrets.GITHUB_TOKEN }}'
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
name: 'tip'
|
name: 'Releaser'
|
||||||
description: "keep a pre-release always up-to-date"
|
description: 'Publish releases, upload assets and update tip/nightly tags'
|
||||||
inputs:
|
inputs:
|
||||||
token:
|
token:
|
||||||
description: 'Token to make authenticated API calls; can be passed in using {{ secrets.GITHUB_TOKEN }}'
|
description: 'Token to make authenticated API calls; can be passed in using {{ secrets.GITHUB_TOKEN }}'
|
||||||
@@ -27,7 +27,7 @@ runs:
|
|||||||
run: pip install PyGithub --progress-bar off
|
run: pip install PyGithub --progress-bar off
|
||||||
|
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: ${{ github.action_path }}/../tip.py
|
run: ${{ github.action_path }}/../releaser.py
|
||||||
env:
|
env:
|
||||||
INPUT_TOKEN: ${{ inputs.token }}
|
INPUT_TOKEN: ${{ inputs.token }}
|
||||||
INPUT_FILES: ${{ inputs.files }}
|
INPUT_FILES: ${{ inputs.files }}
|
||||||
Reference in New Issue
Block a user