Skip to content

Commit

Permalink
Create @matrix-org/spec npm package containing sas-emoji.json (#1620)
Browse files Browse the repository at this point in the history
* Create packages/npm @matrix-org/spec npm package containing spec-emoji

* Initial workflow script

* Add newsfragment

* Add docs

* npm publish doesn't like symlinks, yarn does :((
  • Loading branch information
t3chguy authored Aug 18, 2023
1 parent 4abea9a commit c0babbf
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release packages
on:
release:
types: [published]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
# Releases to npm after bumping the package.json version from 0.0.0 to $TAG.0 as the tags only contain MAJOR.MINOR
npm:
name: Publish to npm
runs-on: ubuntu-latest
if: github.event.release.prerelease == false
defaults:
run:
working-directory: packages/npm
steps:
- name: 🧮 Checkout code
uses: actions/checkout@v3

- name: 🔧 Yarn cache
uses: actions/setup-node@v3
with:
cache: "yarn"
registry-url: "https://registry.npmjs.org"

- name: 🔨 Install dependencies
run: "yarn install --frozen-lockfile"

- name: 🎖 Bump package.json version
run: "yarn version $VERSION"
env:
VERSION: ${{ github.event.release.tag_name }}.0

- name: 🚀 Publish to npm
id: npm-publish
uses: JS-DevTools/npm-publish@5a85faf05d2ade2d5b6682bfe5359915d5159c6c # v2.2.1
with:
token: ${{ secrets.NPM_TOKEN }}
package: packages/npm
access: public
ignore-scripts: false
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Additionally, the following directories may be of interest:
* `/data-definitions`: Bits of structured data consumable by Matrix implementations.
* `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc).
* `/scripts`: Various scripts for generating the spec and validating its contents.
* `/packages`: Various packages for shipping spec files like OpenAPI/swagger bindings and data definitions.

## Authoring changes to the spec

Expand Down
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1620.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Create @matrix-org/spec npm package to ship the SAS Emoji data definitions & translations.
2 changes: 2 additions & 0 deletions packages/npm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
sas-emoji.json
13 changes: 13 additions & 0 deletions packages/npm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@matrix-org/spec",
"version": "0.0.0",
"description": "Data definitions for the Matrix Spec",
"author": "matrix.org",
"license": "Apache-2.0",
"files": [
"sas-emoji.json"
],
"scripts": {
"prepare": "cp ../../data-definitions/sas-emoji.json ."
}
}
4 changes: 4 additions & 0 deletions packages/npm/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit c0babbf

Please sign in to comment.