Skip to content

Commit

Permalink
Automated deployment: Tue Sep 24 10:32:45 UTC 2019 6130af4
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Sep 24, 2019
0 parents commit 49913bf
Show file tree
Hide file tree
Showing 27 changed files with 1,543 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on:
push:
branches:
- '*'
- '!latest'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Pull sources
uses: actions/checkout@v1

- name: Configure Node
uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Install dependencies
run: npm install

- name: Publish
if: github.event.ref == 'refs/heads/master'
run: |
remote_branch=latest
git checkout --orphan "$remote_branch"
git config user.name "$GITHUB_ACTOR"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote rm origin || true
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git remote add origin "$remote_repo"
git add --all
COMMIT_MESSAGE="Automated deployment: $(date -u) $GITHUB_SHA"
git commit -m "$COMMIT_MESSAGE" | true
git push origin "$remote_branch" --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
54 changes: 54 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
= run-cpt
:toc: preamble

[link=https://github.com/grisumbras/run-cpt/actions]
image::https://github.com/grisumbras/run-cpt/workflows/ci/badge.svg[Build status]

____
GitHub Action that runs conan_package_tools
____


== Usage

Example usage:

[source,yaml]
----
uses: grisumbras/run-cpt@latest
with:
build-script: conan/build.py
----

You can set environment variables that control Conan and CPT behaviour using
`env` key:

[source,yaml]
----
- uses: grisumbras/run-cpt@latest
env:
CONAN_REMOTES: https://api.bintray.com/conan/bincrafters/public-conan
----

Additionally, if `CONAN_USERNAME` is not specified, the first part of
`GITHUB_REPOSITORY` (before slash) will be used.


== Inputs

=== `build-script`

Path to the build script. Given `build-script: x/y/z.py`, the action will run
`python x/y/z.py`.


== Maintainer
Dmitry Arkhipov <[email protected]>


== Contributing
Patches welcome!


== License
link:LICENSE[BSL-1.0] (C) 2019 Dmitry Arkhipov
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: run-cpt
author: Dmitry Arkhipov <[email protected]>
description: Runs conan_package_tools
branding:
icon: package
color: blue
inputs:
build-script:
description: Path to the build script
required: false
default: build.py
runs:
using: node12
main: main.js
28 changes: 28 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const core = require('@actions/core');
const exec = require('@actions/exec');


function get_username() {
const repo = process.env['GITHUB_REPOSITORY'] || '';
return (repo.split('/', 1) || [''])[0];
};


async function run() {
try {
console.log('Installing conan_package_tools...')
await exec.exec('pip', ['install', 'conan_package_tools']);

const conan_username = process.env['CONAN_USERNAME'] || get_username();
const opts
= { env: Object.assign({CONAN_USERNAME: conan_username}, process.env)
};

console.log('Running conan_package_tools...')
await exec.exec('python', [core.getInput('build-script')], opts);
} catch (error) {
core.setFailed(error.message);
}
}

run()
97 changes: 97 additions & 0 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/command.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 49913bf

Please sign in to comment.