Skip to content

Commit

Permalink
Oppgraderer node-versjon til 20
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Jul 23, 2024
1 parent cb2a17b commit c28b66a
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 115 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Build and test

on:
push:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build application
run: npm run build
- name: Run tests
run: npm test
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build application
run: npm run build
- name: Run tests
run: npm test
75 changes: 37 additions & 38 deletions .github/workflows/publish-beta.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
name: Publish beta
on:
workflow_dispatch
on: workflow_dispatch

jobs:
publish-beta:
name: Publish to package registry
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Bump version
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
npm version prerelease --preid beta
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build package
run: npm run build
- name: Run tests
run: npm test
- name: Publish package
id: publish
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push new version tag
if: steps.publish.outcome == 'success'
run: git push
publish-beta:
name: Publish to package registry
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Bump version
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
npm version prerelease --preid beta
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build package
run: npm run build
- name: Run tests
run: npm test
- name: Publish package
id: publish
run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push new version tag
if: steps.publish.outcome == 'success'
run: git push
114 changes: 57 additions & 57 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
name: Publish release (master only)
on:
workflow_dispatch:
inputs:
releaseType:
type: choice
required: true
description: 'Release type'
default: 'patch'
options:
- patch
- minor
- major
releaseBody:
type: string
required: true
description: 'Release description'
workflow_dispatch:
inputs:
releaseType:
type: choice
required: true
description: 'Release type'
default: 'patch'
options:
- patch
- minor
- major
releaseBody:
type: string
required: true
description: 'Release description'

jobs:
publish:
name: Publish to package registry
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
contents: write
packages: write
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Bump version
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
echo "VERSION_TAG=$(npm version ${{ github.event.inputs.releaseType }})" >> $GITHUB_ENV
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build package
run: npm run build
- name: Run tests
run: npm test
- name: Publish package
id: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push new version tag
if: steps.publish.outcome == 'success'
run: git push
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
body: ${{ github.event.inputs.releaseBody }}
publish:
name: Publish to package registry
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
contents: write
packages: write
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Bump version
run: |
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
echo "VERSION_TAG=$(npm version ${{ github.event.inputs.releaseType }})" >> $GITHUB_ENV
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Build package
run: npm run build
- name: Run tests
run: npm test
- name: Publish package
id: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push new version tag
if: steps.publish.outcome == 'success'
run: git push
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_TAG }}
body: ${{ github.event.inputs.releaseBody }}

0 comments on commit c28b66a

Please sign in to comment.