Skip to content

Commit

Permalink
ci: ci upgrades and typedoc (#64)
Browse files Browse the repository at this point in the history
* ci: ci upgrades and typedoc

* ci: fixed package upload names
  • Loading branch information
CptSchnitz committed Apr 18, 2024
1 parent ed54b5a commit 2aa8d46
Show file tree
Hide file tree
Showing 17 changed files with 393 additions and 85 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/lint.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # allow GITHUB_TOKEN to publish packages
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run validate
- run: npm run build
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
55 changes: 0 additions & 55 deletions .github/workflows/publish_package.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: pull request

on: [pull_request]

permissions:
pull-requests: write
contents: read

jobs:
eslint:
name: Run TS Project eslint
runs-on: ubuntu-latest

steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 20.x
cache: npm

- name: Install TS Project dependencies
run: npm ci

- name: Run TS Project linters
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.github_token }}
# Enable linters
eslint: true
prettier: true
eslint_extensions: ts

upload_package:
needs: [eslint]
runs-on: ubuntu-latest
steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install TS Project dependencies
run: npm ci
- name: Pack the package
run: npm pack
- name: get properties
id: json_properties
uses: ActionsTools/read-json-action@main
with:
file_path: 'package.json'
- uses: azure/CLI@v2
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.SAS_TOKEN }}
with:
inlineScript: |
az storage blob upload --name telemetry-$GITHUB_SHA.tgz --account-name ghatmpstorage --container-name=npm-packages --file map-colonies-telemetry-${{steps.json_properties.outputs.version}}.tgz
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Hi it is me, your friendly bot helper! :wave:
I've packed this commit for you :blush:
You can install it like this:
```json
{
"dependencies": {
"@map-colonies/schemas": "https://ghatmpstorage.blob.core.windows.net/npm-packages/schemas-${{ github.sha }}.tgz"
}
}
```
The link will expire in a week :hourglass:
24 changes: 24 additions & 0 deletions .github/workflows/release_please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches:
- master

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GH_PAT }}
# this is a built-in strategy in release-please, see "Action Inputs"
# for more options
release-type: node
55 changes: 55 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy typedoc to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['master']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
actions: read
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install TS Project dependencies
run: npm ci
- name: build docs
run: npm run typedoc
- name: build the package
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload docs directory
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 2aa8d46

Please sign in to comment.