Skip to content

Commit

Permalink
feat(chore): automatic npm releases, ci fix and add node 16
Browse files Browse the repository at this point in the history
I would like to automate the npm publishing of new releases, so this PR adds another github workflow which publishes to npm ONLY when a new github release is published.

I intentionally did not implement a version-adjustment inside package.json within the workflow script to avoid publishing wrong releases in case one of us does something wrong while adding tags . So unless we manually change the version number inside package json a possible npm publish will fail (because the old version already exists on npm)

This PR also fixes the CI script, because the node version was always the latest LTS (16) because of a typo in the yml (you could check the CI logs to confirm. So at least this means FUI build well with node16/npm 8 :D (which i also tested manually)

That said, i also increased the node version for the workflows to 14 (not 16, because that is active and could have impact by changes) as node 12 becomes unsupported in april this year
  • Loading branch information
lubber-de authored Jan 20, 2022
1 parent 5650cc0 commit cf327d1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: CI
on: [pull_request]
jobs:
test:
name: Test build process on node ${{ matrix.node_version }}
name: Test build process on node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [8, 10, 11, 12, 13, 14]
node-version: [12, 14, 16]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: pre-install
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'fomantic/Fomantic-UI'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: develop
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- name: pre-setup
run: sh ./scripts/preinstall.sh
Expand All @@ -28,5 +28,5 @@ jobs:
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --tag nightly
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION}}
CI: true
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
release:
types: [released]
jobs:
publish:
name: Build new Release
runs-on: ubuntu-latest
if: github.repository == 'fomantic/Fomantic-UI'
steps:
- uses: actions/checkout@v2
with:
ref: master
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: pre-setup
run: sh ./scripts/preinstall.sh
- name: install dependencies
run: npm install --ignore-scripts
- name: fomantic install & build
run: npx gulp install
- name: publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTOMATION}}
CI: true

0 comments on commit cf327d1

Please sign in to comment.