Skip to content

Commit a083847

Browse files
committed
ci: add pre-release publish workflow
1 parent 921436b commit a083847

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish pre-release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
publish-package:
14+
name: Publish package
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: 20
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build package version
31+
id: pkg
32+
run: |
33+
export PREID='${{ github.event_name == 'pull_request' && 'pr' || 'rc' }}'
34+
export PREID_NUMBER_PR='${{ github.event.pull_request.number }}.${{ github.run_id }}'
35+
export PREID_NUMBER_RC='${{ github.run_id }}'
36+
export PREID_NUMBER="${{ github.event_name == 'pull_request' && '$PREID_NUMBER_PR' || '$PREID_NUMBER_RC' }}"
37+
export CURRENT_VERSION=$(cat package.json | jq -r .version)
38+
export VERSION="$CURRENT_VERSION-${PREID}.${PREID_NUMBER}"
39+
export PACKAGE_NAME="$(cat package.json | jq -r .name)"
40+
echo "name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
41+
echo "version=$VERSION" >> $GITHUB_OUTPUT
42+
echo "Publishing for version $VERSION"
43+
44+
- name: Bump package.json version
45+
run: |
46+
git config --global user.email "${{github.actor}}"
47+
git config --global user.name "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
48+
npm version ${{ steps.pkg.outputs.version }}
49+
50+
- name: Build
51+
run: npm run embeddable:package
52+
53+
- name: Publish
54+
run: |
55+
npm config set '//npm.pkg.github.com/:_authToken=${{ github.token }}'
56+
npm publish
57+
echo 'Install via npm:' >> $GITHUB_STEP_SUMMARY
58+
echo '<pre><code>npm install --save-exact ${{ steps.pkg.outputs.name }}@${{ steps.pkg.outputs.version }}</code></pre>' >> $GITHUB_STEP_SUMMARY
59+
echo 'Install via yarn classic:' >> $GITHUB_STEP_SUMMARY
60+
echo '<pre><code>yarn add --exact ${{ steps.pkg.outputs.name }}@${{ steps.pkg.outputs.version }}</code></pre>' >> $GITHUB_STEP_SUMMARY
61+
echo 'Install via package.json:' >> $GITHUB_STEP_SUMMARY
62+
echo '<pre><code>"${{ steps.pkg.outputs.name }}": "${{ steps.pkg.outputs.version }}"</code></pre>' >> $GITHUB_STEP_SUMMARY

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!IMPORTANT]
2+
> This is a fork of [emebeddable's vanilla components](https://github.com/embeddable-hq/vanilla-components-v1) check the [/docs](./docs) for more information.
3+
14
# Embeddable.com Starter Pack
25

36
Hello and welcome to our Embeddable components **starter pack** built just for you by the Embeddable team ❤️ We wish to thank you for using our platform and welcome any feedback.

docs/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# `@syltek/syltek/embeddable-vanilla-components`
2+
3+
## What is this repo?
4+
5+
This repo is a fork of [`@embeddable.com/vanilla-components`](https://www.npmjs.com/package/@embeddable.com/vanilla-components) published as [`@syltek/syltek/embeddable-vanilla-components`](https://github.com/syltek/embeddable-vanilla-components/pkgs/npm/embeddable-vanilla-components) onto [npm Github Package Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry).
6+
7+
## How to use it?
8+
9+
Add `@syltek/syltek/embeddable-vanilla-components` as a dependency to your package. It is recommended you grab the latest version from [here](https://github.com/syltek/embeddable-vanilla-components/pkgs/npm/embeddable-vanilla-components/versions).
10+
11+
New versions are published every time `main` or an open PR is updated. Stable changes (i.e: changes merged onto `main`) are released marked as `rc` while unstable changes (i.e: Pull Requests) are released marked as `pr`.
12+
13+
### Working _locally_ with a repo that depends onto this one
14+
15+
This is the main use case when working with [embeddable](https://github.com/syltek/embeddable). Let's say you are making changes onto this repo; but you want them reflected onto that one.
16+
17+
Any local-development techniques (such as package linking, bundling and installing the zipped bundle…) would work; but in general those require some knowledge on how the dependency resolution for nodejs application work.
18+
19+
Instead, we recommend you just open a PR here. The PR will trigger a run of the [pre-release publish](https://github.com/syltek/embeddable-vanilla-components/actions) workflow. Once that finishes the job summary will include a version you can install onto [embeddable](https://github.com/syltek/embeddable) and test the changes.
20+
21+
## How to upgrade from the upstream?
22+
23+
We refer to the default [embeddable vanilla components](https://github.com/embeddable-hq/vanilla-components-v1) as the _upstream_.
24+
25+
From time to time we will want to merge their available new features and fixes into this fork. Here is a quick cheatsheet of the commands to do that:
26+
27+
```bash
28+
git remote add -f embeddable [email protected]:embeddable-hq/vanilla-components-v1.git
29+
git checkout main
30+
git merge emebeddable/main
31+
```
32+
33+
## Motivation
34+
35+
We really like emeddable vanilla components; but we had some needs that were not properly covered:
36+
37+
- lack of i18n support
38+
- missing "fine-grained" customizations on some dropdown elements (like the options available within the DateRangePicker)
39+
40+
After some internal discussion and conversations with the embeddable team; we decided to fork the repo and

0 commit comments

Comments
 (0)