Skip to content

Commit

Permalink
Add github actions for all projects
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwurtz committed Sep 22, 2020
1 parent 48e80d6 commit c85d0d8
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release beta release

on:
release:
types: [prereleased]

jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
-
name: Set major version
env:
VERSION: ${{ github.ref }}
run: MAJOR_VERSION=`sed -E 's/[^0-9]+?([0-9]+)\.([0-9]+)\.([0-9]+).+?/\1/' <<< $VERSION` && echo "::set-env name=MAJOR_VERSION::$MAJOR_VERSION"

-
name: Trigger Circle CI API
env:
VERSION: ${{ github.ref }}
CIRCLE_API_TOKEN: ${{ secrets.CIRCLE_API_TOKEN }}
run: >
curl --request POST
--url https://circleci.com/api/v2/project/github/jolicode/redirection.io/pipeline
--header "Circle-Token: $CIRCLE_API_TOKEN"
--header "Content-Type: application/json"
--data "
{
\"branch\":\"master\",
\"parameters\": {
\"run_main\":false,
\"run_php_sdk\": false,
\"run_lint\": false,
\"release_env\": \"production\",
\"release_channel\": \"beta\",
\"release_main_version_dir\": \"$MAJOR_VERSION\",
\"release_nginx_module_version\": \"$VERSION\"
}
}
"
40 changes: 40 additions & 0 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release stable release

on:
release:
types: [released]

jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
-
name: Set major version
env:
VERSION: ${{ github.ref }}
run: MAJOR_VERSION=`sed -E 's/[^0-9]+?([0-9]+)\.([0-9]+)\.([0-9]+).+?/\1/' <<< $VERSION` && echo "::set-env name=MAJOR_VERSION::$MAJOR_VERSION"

-
name: Trigger Circle CI API
env:
VERSION: ${{ github.ref }}
CIRCLE_API_TOKEN: ${{ secrets.CIRCLE_API_TOKEN }}
run: >
curl --request POST
--url https://circleci.com/api/v2/project/github/jolicode/redirection.io/pipeline
--header "Circle-Token: $CIRCLE_API_TOKEN"
--header "Content-Type: application/json"
--data "
{
\"branch\":\"master\",
\"parameters\": {
\"run_main\":false,
\"run_php_sdk\": false,
\"run_lint\": false,
\"release_env\": \"production\",
\"release_channel\": \"stable\",
\"release_main_version_dir\": \"$MAJOR_VERSION\",
\"release_nginx_module_version\": \"$VERSION\"
}
}
"

0 comments on commit c85d0d8

Please sign in to comment.