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 #171 from core23/ci-pipeline
Update CI pipeline
- Loading branch information
Showing
5 changed files
with
1,793 additions
and
307 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
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,81 @@ | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
|
||
name: "Merge" | ||
|
||
jobs: | ||
merge: | ||
name: "Merge" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
if: > | ||
success() && | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.draft == false && | ||
contains(github.event.pull_request.labels.*.name, 'automerge') | ||
steps: | ||
- name: "Request review from @nucleos-bot" | ||
uses: "actions/github-script@v3" | ||
with: | ||
github-token: ${{ secrets.NUCLEOS_BOT_TOKEN }} | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
const reviewers = [ | ||
"nucleos-bot", | ||
] | ||
await github.pulls.requestReviewers({ | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
reviewers: reviewers, | ||
}) | ||
- name: "Assign @nucleos-bot" | ||
uses: "actions/github-script@v3" | ||
with: | ||
github-token: ${{ secrets.NUCLEOS_BOT_TOKEN }} | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
const reviewers = [ | ||
"nucleos-bot", | ||
] | ||
await github.issues.addAssignees({ | ||
assignees: reviewers, | ||
issue_number: pullRequest.number, | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
}) | ||
- name: "Approve pull request" | ||
uses: "actions/github-script@v3" | ||
if: "github.actor != 'nucleos-bot'" | ||
with: | ||
github-token: ${{ secrets.NUCLEOS_BOT_TOKEN }} | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
await github.pulls.createReview({ | ||
event: "APPROVE", | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
}) | ||
- name: "Merge pull request" | ||
uses: "actions/github-script@v3" | ||
with: | ||
github-token: ${{ secrets.NUCLEOS_BOT_TOKEN }} | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
await github.pulls.merge({ | ||
merge_method: "merge", | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
}) |
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,14 +1,63 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: "Draft Release" | ||
|
||
jobs: | ||
update_release_draft: | ||
draft-release: | ||
name: "Update release notes" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: toolmantim/release-drafter@v5.13.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
changelog-linker: | ||
name: "Link changelog entries" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- 7.4 | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v2.3.4 | ||
with: | ||
ref: "${{ github.head_ref }}" | ||
token: ${{ secrets.NUCLEOS_BOT_TOKEN }} | ||
|
||
- name: "Install PHP with extensions" | ||
uses: shivammathur/setup-php@2.9.0 | ||
with: | ||
coverage: none | ||
extensions: "mbstring, json" | ||
php-version: 7.4 | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache | ||
key: ${{ matrix.php-version }}-composer- | ||
restore-keys: | | ||
${{ matrix.php-version }}-composer- | ||
- name: "Install locked dependencies with composer" | ||
run: composer install --no-interaction --no-progress --no-suggest | ||
|
||
- name: "Run changelog-linker" | ||
run: vendor/bin/changelog-linker link | ||
|
||
- name: "Commit changes" | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_user_name: "Nucleos Bot" | ||
commit_user_email: "ci@nucleos.rocks" | ||
commit_author: "Nucleos Bot <ci@nucleos.rocks>" | ||
commit_message: "Link CHANGLOG users and PRs" |
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
Oops, something went wrong.