Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added workflows for semantic release replace plugin #18

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/auto-merge-dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ jobs:
permissions:
contents: read

semantic-release-replace-tests:
if: ${{ contains(inputs.repository, 'semantic-release-replace') }}
uses: ./.github/workflows/semantic-release-replace-test.yml
secrets: inherit
permissions:
contents: read

dependabot:
name: Auto-merge Dependabot PR
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
Expand All @@ -83,7 +90,8 @@ jobs:
- blesta-ispapi-tests
- gulp-release-notification-plugin-tests
- php-idna-translator-tests
if: ${{ github.actor == 'dependabot[bot]' && (success() || needs.perl-sdk-tests.result == 'success' || needs.python-sdk-tests.result == 'success' || needs.php-sdk-tests.result == 'success' || needs.java-sdk-tests.result == 'success' || needs.node-sdk-tests.result == 'success' || needs.go-sdk-tests.result == 'success' || needs.blesta-ispapi-tests.result == 'success' || needs.gulp-release-notification-plugin-tests.result == 'success' || needs.php-idna-translator-tests.result == 'success') }}
- semantic-release-replace-tests
if: ${{ github.actor == 'dependabot[bot]' && (success() || needs.perl-sdk-tests.result == 'success' || needs.python-sdk-tests.result == 'success' || needs.php-sdk-tests.result == 'success' || needs.java-sdk-tests.result == 'success' || needs.node-sdk-tests.result == 'success' || needs.go-sdk-tests.result == 'success' || needs.blesta-ispapi-tests.result == 'success' || needs.gulp-release-notification-plugin-tests.result == 'success' || needs.php-idna-translator-tests.result == 'success' || needs.semantic-release-replace-tests.result == 'success') }}
permissions:
contents: write
pull-requests: write
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ jobs:
contents: write
issues: write
deployments: write

semantic-release-replace-release:
if: ${{ contains(inputs.repository, 'semantic-release-replace') }}
uses: ./.github/workflows/semantic-release-replace-release.yml
secrets: inherit
permissions:
contents: write
issues: write
deployments: write
43 changes: 43 additions & 0 deletions .github/workflows/semantic-release-replace-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
workflow_call:

jobs:
tests:
uses: ./.github/workflows/semantic-release-replace-test.yml
secrets: inherit
permissions:
contents: read

release:
name: Release @ ${{ vars.RTLDEV_MW_CI_OS }}
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
needs: tests
permissions:
contents: write
issues: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup NodeJS ${{ vars.RTLDEV_MW_CI_NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: '${{ vars.RTLDEV_MW_CI_NODE_VERSION }}'
check-latest: true
cache: npm
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }}
COMMIT_SHA: ${{ github.sha }}
# TODO move npm run documentation to semantic-release
run: |
npm run all
npx semantic-release
52 changes: 52 additions & 0 deletions .github/workflows/semantic-release-replace-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Linting & Coverage
on:
workflow_call:

jobs:
test:
name: 🧪 Linting
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Super Linter Code Base
uses: github/super-linter/slim@v5
env:
FILTER_REGEX_INCLUDE: "/src/*"
DEFAULT_BRANCH: main
VALIDATE_TYPESCRIPT_ES: true
VALIDATE_ALL_CODEBASE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test_matrix:
strategy:
matrix:
node-version: ${{ fromJson(vars.RTLDEV_MW_CI_NODE_MATRIX) }}

name: 🧪 Testing
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
needs: test
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Build & Validation
run: |
npm ci
npm run lint
npm run test