Skip to content

Commit

Permalink
chore(ci-cd): Move to GitHub Actions (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion authored Nov 25, 2023
1 parent 666e154 commit 28a216b
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 152 deletions.
126 changes: 0 additions & 126 deletions .circleci/config.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_call:

concurrency:
group: ci-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
nodejs: [16, 17, 18, 19, 20]
rxjs: [5, 6, 7]
axios: ["1.0", 1.1, 1.2, 1.3, 1.4]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodejs }}
cache: yarn
- run: yarn install --immutable
- run: yarn add --dev rxjs@~${{ matrix.rxjs }}
- run: yarn add --dev axios@^${{ matrix.axios }}
- run: yarn compile
- run: yarn lint
- run: yarn test --forbid-only

check:
runs-on: ubuntu-latest
needs: build

steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJson(needs) }}
2 changes: 0 additions & 2 deletions .github/workflows/owner-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
approve:
if: github.actor == github.repository_owner
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3
with:
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---

name: Pages

on:
push:
branches: [release]
workflow_call:
workflow_dispatch:

permissions:
contents: read
Expand All @@ -13,24 +11,20 @@ permissions:

concurrency:
group: pages
cancel-in-progress: true
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
- uses: actions/checkout@v4
- uses: actions/configure-pages@v3
- uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- uses: actions/upload-pages-artifact@v2

deploy:
environment:
Expand All @@ -40,8 +34,5 @@ jobs:
needs: build

steps:
- name: Deploy to GitHub Pages
- uses: actions/deploy-pages@v2
id: deployment
uses: actions/deploy-pages@v2

...
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:

concurrency:
group: release
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/ci.yml

release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
issues: write
pull-requests: write
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

pages:
needs: release
uses: ./.github/workflows/pages.yml
8 changes: 6 additions & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"$schema": "https://json.schemastore.org/semantic-release",
"branches": [
"release"
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"semantic-release-yarn",
"@semantic-release/github"
]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"release": "semantic-release",
"test": "NODE_ENV=test mocha"
},
"packageManager": "[email protected]",
"devDependencies": {
"@stackbuilders/assertive-ts": "^1.2.0",
"@types/mocha": "^10.0.1",
Expand All @@ -53,6 +54,7 @@
"msw": "^1.2.2",
"rxjs": "^7.8.1",
"semantic-release": "^21.0.7",
"semantic-release-yarn": "^3.0.2",
"sinon": "^15.2.0",
"ts-node": "^10.9.1",
"tslib": "^2.6.0",
Expand All @@ -70,5 +72,8 @@
"optional": false
}
},
"packageManager": "[email protected]"
"publishConfig": {
"access": "public",
"provenance": true
}
}
Loading

0 comments on commit 28a216b

Please sign in to comment.