parent
df4e3a97c0
commit
07b34f1b37
2 changed files with 74 additions and 3 deletions
71
.forgejo/workflows/build.yaml
Normal file
71
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,71 @@
|
|||
on:
|
||||
push:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build:
|
||||
description: "Build package"
|
||||
required: true
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: container
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get the version from git
|
||||
id: version
|
||||
run: echo "version=$(git describe --dirty --tags)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if the package should be built
|
||||
id: builder
|
||||
env:
|
||||
RUN: ${{ toJSON(inputs.build || !contains(steps.version.outputs.version, '-')) }}
|
||||
run: |
|
||||
echo "run=$RUN" >> $GITHUB_OUTPUT
|
||||
echo "Run build: $RUN"
|
||||
|
||||
- name: Info - version and if the image container should be built
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
RUN: ${{ steps.builder.outputs.run }}
|
||||
FORCE: ${{ toJSON(inputs.build) }}
|
||||
run: |
|
||||
echo "Version $VERSION, force (manual input): $FORCE, run the build: $RUN"
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Update version.json from git describe
|
||||
run: pnpm run version
|
||||
|
||||
- name: Set the version in package.json
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
run: sed "s/0.0.0/${VERSION}/" -i package.json
|
||||
|
||||
- name: Build package (transpile ts => js)
|
||||
run: pnpm run build --base /oidc-test-web
|
||||
|
||||
- name: Set registry token for pnpm"
|
||||
env:
|
||||
LOCAL_NPM_TOKEN: ${{ secrets.LOCAL_NPM_TOKEN }}
|
||||
run: pnpm set "//code.philo.ydns.eu/api/packages/philorg/npm/:_authToken=${LOCAL_NPM_TOKEN}"
|
||||
|
||||
- name: Publish
|
||||
if: fromJSON(steps.builder.outputs.run)
|
||||
run: pnpm publish --no-git-checks
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"name": "typescript",
|
||||
"name": "oidc-text-web",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --port 3000",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build"
|
||||
"type-check": "vue-tsc --build",
|
||||
"version": "echo \"{\\\"version\\\":\\\"$(git describe --tags --dirty --always)\\\"}\" > src/version.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dsb-norge/vue-keycloak-js": "^3.0.1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue