Skip to content

Commit

Permalink
fix publish to GitHub Packages (#14)
Browse files Browse the repository at this point in the history
* fix: 🐛release bug

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 build publish to github packages

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 fix textlint errors

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 add in textlint config rules

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ➖ remove textlint til i can figure it out

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: fix linting issues

Signed-off-by: super-linter <super-linter@super-linter.dev>

---------

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Signed-off-by: super-linter <super-linter@super-linter.dev>
Co-authored-by: iamnewton <iamnewton@users.noreply.github.com>
  • Loading branch information
iamnewton and iamnewton authored Oct 25, 2024
1 parent 208677f commit 63b8b52
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
VALIDATE_JSON_PRETTIER: true
VALIDATE_JSX_PRETTIER: true
VALIDATE_MARKDOWN_PRETTIER: true
VALIDATE_NATURAL_LANGUAGE: true
# VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_TSX: true
VALIDATE_TYPESCRIPT_PRETTIER: true
VALIDATE_YAML: true # turning on for now while prettier is broken
Expand Down
38 changes: 24 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Publish

# @TODO: check if this could replace changesets
# if so, i can get rid of the publish command and changesets

on: # yamllint disable-line rule:truthy
push:
branches:
Expand All @@ -26,36 +23,49 @@ jobs:
# the workflow run. For example, `main` or `1.x`
target-branch: ${{ github.ref_name }}

publish-npm:
name: Publish to NPM
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
name: Checkout repository
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v4
name: Setup Node.js @v20
if: ${{ steps.release.outputs.release_created }}
with:
cache: npm
node-version: 20.x
registry-url: 'https://registry.npmjs.org'

- run: npm ci
name: Install dependencies
if: ${{ steps.release.outputs.release_created }}

- run: npm publish --access public
- run: npm publish
name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}

- run: npm config set registry https://npm.pkg.github.com/
name: Set up GitHub registry
if: ${{ steps.release.outputs.release_created }}
publish-gh:
name: Publish to GitHub
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
name: Checkout repository

- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
scope: '@theholocron'

- run: npm ci
name: Install dependencies

- run: npm publish --access public
name: Publish to GitHub Packages
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
1 change: 0 additions & 1 deletion .textlintignore

This file was deleted.

3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## [0.2.1](https://github.com/theholocron/react-template/compare/v0.2.0...v0.2.1) (2024-10-25)


### Bug Fixes

* 💚 enable publish to npm, gh ([#12](https://github.com/theholocron/react-template/issues/12)) ([a2fed19](https://github.com/theholocron/react-template/commit/a2fed19a61e8384574c5cec85c6f2591177f554b))
- 💚 enable publish to npm, gh ([#12](https://github.com/theholocron/react-template/issues/12)) ([a2fed19](https://github.com/theholocron/react-template/commit/a2fed19a61e8384574c5cec85c6f2591177f554b))

## [0.2.0](https://github.com/theholocron/react-template/compare/v0.1.0...v0.2.0) (2024-10-25)

Expand Down
1 change: 1 addition & 0 deletions cypress.config.js → cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
baseUrl: "http://localhost:5173/", // this is the default port for `vite` that runs a server
specPattern: "src/**/*.{cy.js,cy.ts}",
supportFile: false,
retries: 2,
},
projectId: "6dsxao",
});
108 changes: 68 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"version": "0.2.1",
"repository": {
"type": "git",
"url": "git+https://github.com/theholocron/react-template.git"
"url": "https://github.com/theholocron/react-template.git"
},
"bugs": "https://github.com/theholocron/react-template/issues",
"releases": "https://github.com/theholocron/react-template/releases",
Expand Down Expand Up @@ -58,6 +58,10 @@
"test:cypress": "cypress open",
"test:storybook": "test-storybook --coverage"
},
"engines": {
"node": ">=23",
"npm": ">=10"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
Expand Down

0 comments on commit 63b8b52

Please sign in to comment.