Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up .npmignore to publish .d.ts files #81

Merged
merged 2 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Release

on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
inputs:
release-type:
description: 'Release Type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease
prerelease:
description: 'Prerelease'
required: true
default: false
type: boolean
skip-if-no-diff:
description: 'Skip if no diff'
required: true
default: false
type: boolean
diff-targets:
description: 'Diff Targets'
required: false
default: 'data.json'
type: string
dry-run:
description: 'Dry run'
required: true
default: false
type: boolean

jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit

codeql:
uses: ./.github/workflows/codeql.yml

release:
name: Release
needs: [build, codeql]
concurrency: release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.release.outputs.tag }}
skipped: ${{ steps.release.outputs.skipped }}
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
fetch-depth: 0

- id: release
uses: CatChen/node-package-release-action@v1
with:
release-type: ${{ inputs.release-type || 'patch' }}
prerelease: ${{ inputs.prerelease || false }}
update-shorthand-release: true
dry-run: ${{ inputs.dry-run || false }}
skip-if-no-diff: ${{ inputs.skip-if-no-diff || true }}
diff-targets: ${{ inputs.diff-targets || 'data.json' }}

publish:
name: Publish
needs: [release]
if: ${{ needs.release.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: ${{ !inputs.dry-run }}
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/checkout@v3
if: ${{ inputs.dry-run }}
with:
ref: ${{ github.ref_name || github.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
check-latest: true
registry-url: https://registry.npmjs.org/
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
DRY_RUN: ${{ inputs.dry-run || false }}
run: |
yarn install
yarn build
npm whoami
npm config ls -l
if [[ "$DRY_RUN" = true ]]
then
npm publish --access public --dry-run
else
npm publish --access public
fi
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.github
.nvmrc
6 changes: 5 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import rawData from "./data.json";
import rawData from './data.json';
import generatedSchema from './schemas.json';

import { Schema } from 'ajv';

export type Opening = {
available: boolean;
Expand Down Expand Up @@ -26,3 +29,4 @@ export type JobsData = {
};

export const data: JobsData = rawData;
export const schema: Schema = generatedSchema;