Skip to content

Commit

Permalink
tags -> labels; complete README; misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhswenson committed May 5, 2021
1 parent 9eda590 commit d186b42
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/example_triggered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.ref }}
- run: echo "Here's where I'd run my tests"

7 changes: 5 additions & 2 deletions .github/workflows/example_use.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on:
# This is used in testing here, so we check against PRs and pushes, as
# well as testing every day. In a real use case, you'd probably only use
# the `schedule` type, and possibly not every day.
pull_request:
branches:
- main
Expand All @@ -7,7 +10,7 @@ on:
- main

schedule:
- cron: "0 0 * * 0"
- cron: "0 0 * * *"

defaults:
run:
Expand All @@ -25,7 +28,7 @@ jobs:
channel: conda-forge
package: openmm
ndays: 30
tags: 'main openmm_rc'
labels: 'main openmm_rc'
- run: echo ${{ steps.check.outputs.hasrc }}
- uses: benc-uk/workflow-dispatch@v1
with:
Expand Down
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,51 @@ to a conda channel. In general, you won't need to do nightly builds against the
most recent release candidate *every* night, but you don't want to miss when an
RC is posted.

The idea is that you'd have a workflow that schedules this action once every
`ndays` (default is `ndays=7`), and if an RC had been released in that time,
you would trigger another workflow to install the RC and test your code against
it.
This workflow checks whether a release candidate has been added within the last
`ndays` days. It sets the value of its output `hasrc`, to either the string
`'True'` if such an RC is present, or the string `'False'` if not.

The assumption is that you'll create a scheduled workflow that calls this
action, and depending on the result, triggers some other workflow. An example
of this is in
[`.github/workflows/example_use.yml`](https://github.com/dwhswenson/conda-rc-check/blob/main/.github/workflows/example_use.yml).

## Inputs

### `channel`

**Required** Channel where the package is found. Default `'conda-forge'`. Note:
if using the "defaults" channel, you must actually specify which specific
channel the package comes from (`'main'`, `'r'`, etc.) Verify that there is a page
at `https://anaconda.org/$CHANNEL/$PACKAGE`.

### `package`

**Required** Package name.

### `ndays`
### `tags`

**Required** Max number of days to search for release candidates. Default `7`.

### `labels`

**Required** Space-separated list of conda labels where RCs are found. Default
`main`.

## Outputs
### `hasrc`

Whether there is a release candidate for this package. The string `'True'` if
there is one; `'False'` if not.

## Example usage

```yaml
- id: checkrc
uses: dwhswenson/conda-rc-check@v1
with:
channel: conda-forge
package: openmm
ndays: 7
labels: 'main openmm_rc'
```
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ description: |
Identify whether a recent release candidate has been published on conda.
inputs:
channel:
description: Channel where the package is found
description: Channel where the package is found.
required: true
default: 'conda-forge'
package:
description: Package name
required: true
ndays:
description: return if RC released within this many days
description: Max number of days to search for release candidates.
required: true
default: 7
tags:
description: space-separated list of tag names
labels:
description: Space-separated list of conda labels where RCs are found.
required: true
default: main
outputs:
has_rc:
description: Whether there is a release candidate for this package
description: Whether there is a release candidate for this package.
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.channel }}
- ${{ inputs.package }}
- ${{ inputs.ndays }}
- ${{ inputs.tags }}
- ${{ inputs.labels }}

0 comments on commit d186b42

Please sign in to comment.