Skip to content

Commit

Permalink
feat: add dev builds when pushing on 1-dev (#23)
Browse files Browse the repository at this point in the history
* feat: add dev builds when pushing on 1-dev

* fix: rename main Workflow and remove old workflow
  • Loading branch information
alexandrebouthinon authored Sep 27, 2024
1 parent 92bb591 commit df09739
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 100 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/pull_request.workflow.yml

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/push-and-pr.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Push and PR

on:
push:
branches:
- master
- beta
- "[0-9]+-dev"
pull_request:

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: ./.github/actions/lint

functional-tests:
name: Functional Tests
runs-on: ubuntu-20.04
needs: [lint]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: ./.github/actions/functional-test

release:
name: Release process
needs: [functional-tests]
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/2-dev') }}
runs-on: ubuntu-20.04
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
scope: "@kuzzleio"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GHP }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SEMANTIC_RELEASE_NPM_PUBLISH: "true"
SEMANTIC_RELEASE_SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
run: npx semantic-release

documentation_deploy:
needs: [release]
name: Documentation - Deploy
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/2-dev') }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: convictional/trigger-workflow-and-wait@v1.6.3
with:
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: ${{ github.ref_name == 'master' && 'master' || 'develop' }}
client_payload: '{"repo_name":"kuzzle-plugin-hermes-messenger","branch":"${{ github.ref_name }}","version":"1"}'
58 changes: 0 additions & 58 deletions .github/workflows/push_branches.workflow.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"extends": ["semantic-release-config-kuzzle"],
"branches": [
"master",
{ "name": "beta", "prerelease": true }
{ "name": "beta", "prerelease": true },
{
"name": "+([0-9])-dev",
"prerelease": "dev"
}
]
}

0 comments on commit df09739

Please sign in to comment.