Skip to content

Commit

Permalink
Add changesets and Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tajakobsen committed Aug 12, 2024
1 parent 3d16281 commit c315201
Show file tree
Hide file tree
Showing 5 changed files with 5,477 additions and 6 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- run: pnpm run lint && pnpm run build
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm versioning
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @item-enonic-types/lib-turbo-streams

## 1.1.0

### Minor Changes

- testing
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"dist": "run-p -c dist:*",
"lint": "eslint --fix 'src/**/*.ts'",
"prepublishOnly": "tsc --project src/main/resources/tsconfig.server.json --declarationDir build/types --emitDeclarationOnly true --declaration true && cp -r ./build/types/lib/turbo-streams/* .",
"postpublish": "rm ./*.d.ts"
"postpublish": "rm ./*.d.ts",
"release": "pnpm run build && changeset publish",
"versioning": "pnpm changeset version && NEW_VERSION=$(node -p \"require('./package.json').version\") && sed -i \"s/version.*/version = ${NEW_VERSION}/\" gradle.properties"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down Expand Up @@ -46,9 +48,5 @@
},
"browserslist": [
"extends browserslist-config-enonic"
],
"engines": {
"node": ">= 16.13.1 || >=18.0.0",
"npm": ">= 8.1.2 || >= 9.6.7"
}
]
}
Loading

0 comments on commit c315201

Please sign in to comment.