v4 #23
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
name: CI/CD | |
on: | |
push: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
env: | |
FORCE_COLOR: 3 # Diplay chalk colors | |
jobs: | |
ci: | |
name: Integration | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | |
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d | |
with: | |
version: 9 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version: lts/* | |
cache: pnpm | |
# Generate local TLS certificates to test HTTPS support, using mkcert: | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install & setup mkcert | |
run: | | |
sudo apt install libnss3-tools | |
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" | |
chmod +x mkcert-v*-linux-amd64 | |
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert | |
echo "mkcert version: $(mkcert -version)" | |
mkcert -install | |
- name: Generate TLS certificates | |
run: pnpm mkcert | |
- name: Run integration tests | |
run: pnpm ci | |
- uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 | |
name: Report code coverage | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: 47ng/actions-slack-notify@main | |
name: Notify on Slack | |
if: always() | |
with: | |
jobName: Integration | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
cd: | |
name: Deployment | |
runs-on: ubuntu-latest | |
needs: [ci] | |
if: ${{ github.ref_name == 'main' || github.ref_name == 'beta' || github.ref_name == 'alpha' }} | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | |
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d | |
with: | |
version: 9 | |
run_install: | | |
- args: [--frozen-lockfile] | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version: 16.x | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --ignore-scripts --frozen-lockfile | |
- name: Build package | |
run: pnpm build | |
- name: Sign package | |
run: npx sceau sign | |
env: | |
SCEAU_BUILD_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | |
SCEAU_SOURCE_URL: https://github.com/${{github.repository}}/commit/${{ github.sha }} | |
SCEAU_PRIVATE_KEY: ${{ secrets.SCEAU_PRIVATE_KEY }} | |
- uses: docker://ghcr.io/codfish/semantic-release-action@sha256:16ab6c16b1bff6bebdbcc6cfc07dfafff49d23c6818490500b8edb3babfff29e | |
name: Semantic Release | |
id: semantic | |
with: | |
branches: | | |
[ | |
'main', | |
{ | |
name: 'beta', | |
prerelease: true | |
}, | |
{ | |
name: 'alpha', | |
prerelease: true | |
} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |