Skip to content

Commit c85d0d8

Browse files
committed
Add github actions for all projects
1 parent 48e80d6 commit c85d0d8

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/beta-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release beta release
2+
3+
on:
4+
release:
5+
types: [prereleased]
6+
7+
jobs:
8+
trigger-circleci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Set major version
13+
env:
14+
VERSION: ${{ github.ref }}
15+
run: MAJOR_VERSION=`sed -E 's/[^0-9]+?([0-9]+)\.([0-9]+)\.([0-9]+).+?/\1/' <<< $VERSION` && echo "::set-env name=MAJOR_VERSION::$MAJOR_VERSION"
16+
17+
-
18+
name: Trigger Circle CI API
19+
env:
20+
VERSION: ${{ github.ref }}
21+
CIRCLE_API_TOKEN: ${{ secrets.CIRCLE_API_TOKEN }}
22+
run: >
23+
curl --request POST
24+
--url https://circleci.com/api/v2/project/github/jolicode/redirection.io/pipeline
25+
--header "Circle-Token: $CIRCLE_API_TOKEN"
26+
--header "Content-Type: application/json"
27+
--data "
28+
{
29+
\"branch\":\"master\",
30+
\"parameters\": {
31+
\"run_main\":false,
32+
\"run_php_sdk\": false,
33+
\"run_lint\": false,
34+
\"release_env\": \"production\",
35+
\"release_channel\": \"beta\",
36+
\"release_main_version_dir\": \"$MAJOR_VERSION\",
37+
\"release_nginx_module_version\": \"$VERSION\"
38+
}
39+
}
40+
"

.github/workflows/stable-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release stable release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
trigger-circleci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
-
12+
name: Set major version
13+
env:
14+
VERSION: ${{ github.ref }}
15+
run: MAJOR_VERSION=`sed -E 's/[^0-9]+?([0-9]+)\.([0-9]+)\.([0-9]+).+?/\1/' <<< $VERSION` && echo "::set-env name=MAJOR_VERSION::$MAJOR_VERSION"
16+
17+
-
18+
name: Trigger Circle CI API
19+
env:
20+
VERSION: ${{ github.ref }}
21+
CIRCLE_API_TOKEN: ${{ secrets.CIRCLE_API_TOKEN }}
22+
run: >
23+
curl --request POST
24+
--url https://circleci.com/api/v2/project/github/jolicode/redirection.io/pipeline
25+
--header "Circle-Token: $CIRCLE_API_TOKEN"
26+
--header "Content-Type: application/json"
27+
--data "
28+
{
29+
\"branch\":\"master\",
30+
\"parameters\": {
31+
\"run_main\":false,
32+
\"run_php_sdk\": false,
33+
\"run_lint\": false,
34+
\"release_env\": \"production\",
35+
\"release_channel\": \"stable\",
36+
\"release_main_version_dir\": \"$MAJOR_VERSION\",
37+
\"release_nginx_module_version\": \"$VERSION\"
38+
}
39+
}
40+
"

0 commit comments

Comments
 (0)