Skip to content

Commit

Permalink
CI releases + Inclusivity (#43)
Browse files Browse the repository at this point in the history
* CI releases + Inclusivity

- Automate and secure releases using GitHub Actions
- Inclusivity: Rename git branch master into main

* ml fixes

* cspell
  • Loading branch information
nvuillam authored Nov 18, 2023
1 parent 051db76 commit b2849bf
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"language": "en",
"version": "0.1",
"words": [
"BETAID",
"CIRCLECIPIPELINES",
"CLASSPATH",
"Classpath",
"Gowans",
"Inclusivity",
"KICS",
"PROSELINT",
"Perso",
Expand All @@ -40,11 +42,12 @@
"njre",
"nvuillam",
"oxsecurity",
"preid",
"quoi",
"runned",
"socio",
"someflag",
"someflagwithvalue",
"unhack"
]
}
}
50 changes: 50 additions & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
#
# 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 to NPM
deploy_to_npm:
name: Deploy to NPM (beta)
runs-on: ubuntu-latest
permissions: read-all
environment:
name: beta
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
scope: nvuillam
- run: npm ci
- run: |
git config --global user.name nvuillam
git config --global user.email [email protected]
- run: BETAID=$(date '+%Y%m%d%H%M') && npm version prerelease --preid="beta$BETAID"
shell: bash
- run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
#
# 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_to_npm:
name: Deploy to NPM (release)
runs-on: ubuntu-latest
permissions: read-all
environment:
name: release
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/[email protected]
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
scope: nvuillam
- run: npm ci
- run: |
git config --global user.name nvuillam
git config --global user.email [email protected]
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request:
branches: [master]
branches: [main]

permissions: read-all

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [3.1.0] 2023-11-18

- Use semver module to check found java version instead of custom code
- Add java 17 to test cases
- Automate and secure releases using GitHub Actions
- Inclusivity: Rename git branch master into main

## [3.0.0] 2023-09-19

Expand Down

0 comments on commit b2849bf

Please sign in to comment.