Skip to content

Commit

Permalink
Merge pull request #92 from nvuillam/alpha
Browse files Browse the repository at this point in the history
Automate tests & release from GitHub Actions
  • Loading branch information
junners authored Jun 15, 2024
2 parents 23653a7 + 5cdd595 commit 43eac63
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy-ALPHA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#######################################
# Start the job on all push to master #
#######################################
name: "Build & Deploy - ALPHA"
on:
push:
branches:
- "alpha"

permissions: read-all

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

###############
# Set the Job #
###############
jobs:
deploy:
name: Deploy alpha
runs-on: ubuntu-latest
permissions: read-all
environment:
name: alpha
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
always-auth: true
# Defaults to the user or organization that owns the workflow file
scope: "rubenhalman"
- run: yarn
- run: yarn config set version-git-tag false && tsc -b
- run: ALPHAID=$(date '+%Y%m%d%H%M') && yarn version --prepatch --preid="alpha$ALPHAID"
- run: yarn config set network-timeout 300000 && yarn publish --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/deploy-BETA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#######################################
# Start the job on all push to master #
#######################################
name: "Build & Deploy - BETA"
on:
push:
branches:
- "main"
- "master"

permissions: read-all

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

###############
# Set the Job #
###############
jobs:
deploy:
name: Deploy beta
runs-on: ubuntu-latest
permissions: read-all
environment:
name: beta
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
always-auth: true
# Defaults to the user or organization that owns the workflow file
scope: "rubenhalman"
- run: yarn
- run: yarn config set version-git-tag false && tsc -b
- run: BETAID=$(date '+%Y%m%d%H%M') && yarn version --prepatch --preid="beta$BETAID"
- run: yarn config set network-timeout 300000 && yarn publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/deploy-RELEASE.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#######################################
# Start the job on all push to master #
#######################################
name: "Build & Deploy - RELEASE"
on:
release:
# Want to run the automation when a release is created
types: ["created"]

permissions: read-all

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

###############
# Set the Job #
###############
jobs:
deploy:
runs-on: ubuntu-latest
permissions: read-all
environment:
name: release
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
scope: "rubenhalman"
- run: yarn
- run: yarn config set network-timeout 300000 && yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Fix wrong exit code which has to be related to --failon option (default: `error`)
- Display severity in human format results
- Automate Releases via GitHub Actions
- From `master` branch: **beta**
- From `alpha` branch: **alpha**
- When a GitHub release is created: Git tag selected for the release.
- Run tests during Pull Request checks

## [2.12.0] 2023-08-29

Expand Down

0 comments on commit 43eac63

Please sign in to comment.