Skip to content

chore(release): 3.0.0 #23

chore(release): 3.0.0

chore(release): 3.0.0 #23

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Johannes Loher
#
# SPDX-License-Identifier: MIT
name: Publish
on:
push:
tags:
- 'v*.*.*'
env:
node_version: 18
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Install node
uses: actions/[email protected]
with:
node-version: ${{ env.node_version }}
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline
- name: Lint
run: npm run lint
- name: Format Check
run: npm run format:check
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
- name: Build
run: npm run build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
publish-to-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/[email protected]
with:
node-version: ${{ env.node_version }}
- name: Cache Node.js modules
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --cache .npm --prefer-offline
- name: Download production artifacts for publication
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --ignore-scripts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-to-dockerhub:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: johannesloher/foundry-publish
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}