-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): no more Travis, replaced by GitHub Actions with Semantic Re…
…lease
- Loading branch information
Showing
6 changed files
with
232 additions
and
12 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,49 @@ | ||
|
||
name: "Bump version" | ||
run-name: "Bump a new version tag" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- master-bootstrap-4 | ||
- master-bootstrap-5 | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
|
||
bump_release: | ||
name: "Bump version" | ||
if: "!contains(github.event.head_commit.message, 'chore(release)')" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- name: Install dependencies | ||
run: npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/exec @saithodev/semantic-release-backmerge | ||
|
||
- name: Setup git | ||
run: | | ||
git config user.email "${{ env.GITHUB_TRIGGERING_ACTOR }}" | ||
git config user.name "github-ci-bot" | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
run: npx semantic-release |
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,54 @@ | ||
|
||
name: "Begin new release" | ||
run-name: "Create a new release branch forking dev" | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
|
||
begin_release: | ||
name: "Begin next release" | ||
if: ${{ (github.ref_name == 'dev' || contains(github.ref_name, 'dev-')) && github.event_name == 'workflow_dispatch' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
|
||
- name: debug | ||
run: printenv; git remote -v; git status; | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
|
||
- name: Install dependencies | ||
run: npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/exec @saithodev/semantic-release-backmerge | ||
|
||
- name: Setup git | ||
run: | | ||
git config user.email "${{ env.GITHUB_TRIGGERING_ACTOR }}" | ||
git config user.name "github-ci-bot" | ||
- name: Create the release branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
run: | | ||
git pull | ||
semantic-release --dry-run --no-ci | ||
NEXT_VERSION=$(cat /tmp/next_release) | ||
git checkout -b "release-${NEXT_VERSION}" | ||
git push origin release-${NEXT_VERSION} | ||
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,61 @@ | ||
|
||
name: "Publish release" | ||
run-name: "Publish a release by merging it to master and deleting the release branch" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
targetBranch: | ||
description: 'Target branch' | ||
required: true | ||
default: 'master' | ||
type: choice | ||
options: | ||
- master | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
|
||
bump_release: | ||
name: "Publish release" | ||
if: ${{ contains(github.ref_name, 'release-') && github.event_name == 'workflow_dispatch' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
|
||
- name: Setup git | ||
run: | | ||
git config user.email "${{ env.GITHUB_TRIGGERING_ACTOR }}" | ||
git config user.name "github-ci-bot" | ||
- name: Merging release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
run: | | ||
git fetch | ||
git rev-parse --verify ${{ inputs.targetBranch }} && git branch -D ${{ inputs.targetBranch }} | ||
git checkout --force --track origin/${{ inputs.targetBranch }} | ||
git reset --hard origin/${{ inputs.targetBranch }} | ||
git merge --no-ff --no-edit --no-commit origin/${{ github.ref_name }} | ||
NEED_COMMIT=$(git diff --name-status --cached --exit-code 1>/dev/null; echo $?;) | ||
if [[ $NEED_COMMIT == 1 ]] | ||
then | ||
git commit -m "ci(${{ github.ref_name }}): merging prepared release" | ||
git push origin ${{ inputs.targetBranch }} | ||
else | ||
echo "> no changes to be commited on ${{ inputs.targetBranch }}" | ||
echo "> no new release to bump" | ||
fi | ||
# delete release branch | ||
git push --delete origin ${{ github.ref_name }} |
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,39 @@ | ||
|
||
name: "Run tests" | ||
run-name: "Run Unit tests & cs-fixer for validation" | ||
|
||
on: | ||
push: | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
jobs: | ||
|
||
bump_release: | ||
name: "PHP unit tests & code standards" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
|
||
- name: Install composer dependencies | ||
uses: php-actions/composer@v6 | ||
|
||
- name: Run CS-Fixer | ||
uses: php-actions/composer@v6 | ||
with: | ||
command: run cs-fixer-ci | ||
|
||
- name: Run unit tests | ||
uses: php-actions/composer@v6 | ||
with: | ||
command: run test |
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,29 @@ | ||
|
||
branches: | ||
- "+([0-9])?(.{+([0-9]),x}).x" | ||
- name: "master" | ||
- name: "dev" | ||
- name: "release-*" | ||
prerelease: "alpha" | ||
|
||
plugins: | ||
- path: "@semantic-release/commit-analyzer" | ||
- path: "@semantic-release/release-notes-generator" | ||
commit: "/commit" | ||
- path: "@semantic-release/github" | ||
- path: "@semantic-release/changelog" | ||
changelogFile: "CHANGELOG.md" | ||
changelogTitle: "# Markdown Extended changelog" | ||
- path: "@semantic-release/git" | ||
assets: | ||
- "CHANGELOG.md" | ||
message: | | ||
chore(release): ${nextRelease.version} | ||
${nextRelease.notes} | ||
- path: "@semantic-release/exec" | ||
verifyReleaseCmd: "echo \"${nextRelease.version}\" > /tmp/next_release" | ||
- path: "@saithodev/semantic-release-backmerge" | ||
backmergeBranches: | ||
- from: "master" | ||
to: "dev" |
This file was deleted.
Oops, something went wrong.