-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from MetRonnie/content
Add the actions
- Loading branch information
Showing
19 changed files
with
1,667 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
}, | ||
"rules": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Style test | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
style-test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/[email protected] | ||
|
||
- name: Install (dev) dependencies | ||
run: npm install | ||
|
||
- name: Style test | ||
run: npx eslint . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules/** | ||
|
||
!node_modules/cylc-action-utils.js | ||
# Have put that file in node_modules so that we don't have to specify the path to it every time we require() it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# release-actions | ||
|
||
GitHub Actions for automating releases | ||
|
||
## Usage | ||
|
||
Use the repository + path to the action subdirectory in the workflow. | ||
|
||
As an example - in a workflow's `jobs.<job_id>.steps` section: | ||
```yaml | ||
- name: Create & checkout PR branch | ||
uses: cylc/release-actions/stage-1/checkout-pr-branch@v1 | ||
``` | ||
Some actions require inputs or env variables, e.g. | ||
```yaml | ||
- name: Comment on the release PR with the results & next steps | ||
uses: cylc/release-actions/stage-2/comment-on-pr@v1 | ||
with: | ||
release-url: ${{ steps.create-release.outputs.html_url }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
See the `action.yml` file for what is required for a particular action. | ||
|
||
## Contributing | ||
|
||
The `v1` tag should be updated to point at the latest release that maintains backwards compatibility. | ||
|
||
Note: Certain modules (e.g. `cylc-action-utils.js`) may be kept in `node_modules/` so that they don't have to be referenced by path when using `require()`, and should be unignored in `.gitignore`. For some reason, `yarn install` causes these modules to be deleted, so stick to `npm install`. | ||
|
||
Info on "composite run step" actions: | ||
- https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action | ||
- https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) NIWA & British Crown (Met Office) & Contributors. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Check if two PEP 440 compliant Python package version numbers are equal. | ||
Usage: | ||
$ cmp_py_versions <version_number1> <version_number2> | ||
You can also check if a single version number is valid by passing it twice. | ||
""" | ||
|
||
import sys | ||
import packaging.version | ||
|
||
ver1, ver2 = [packaging.version.Version(i) for i in sys.argv[1:3]] | ||
|
||
if ver1 != ver2: | ||
print(f'{ver1} not equal to {ver2}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Build Python package | ||
description: Build Python package wheel distribution. Can also be run in test mode. | ||
inputs: | ||
dry-run: | ||
description: If true, merely test the build process in a temporary directory | ||
required: false | ||
default: false | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
env: | ||
IS_TEST: ${{ inputs.dry-run }} | ||
run: | | ||
if "$IS_TEST"; then | ||
cd $( mktemp -d ) | ||
python3 "${{ github.workspace }}/setup.py" bdist_wheel | ||
else | ||
python3 setup.py bdist_wheel sdist | ||
fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.