Compare commits

..

No commits in common. "master" and "v1.1.17" have entirely different histories.

18 changed files with 22678 additions and 63010 deletions

View File

@ -10,13 +10,9 @@ updates:
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "daily"
groups:
typescript:
patterns:
- "typescript"
- "@voxpelli/tsconfig"
# Enable updates to github actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View File

@ -5,12 +5,12 @@ on:
push:
branches:
- master
env:
FORCE_COLOR: 1
node_version: lts/*
node_version: 16
concurrency: # prevent concurrent deploys doing strange things
concurrency: # prevent concurrent deploys doing starnge things
group: deploy-to-neocities
cancel-in-progress: true
@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v3
# Set up any tools and build steps here
# This example uses a Node.js toolchain to build a site
- name: Use Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- run: npm i
@ -32,9 +32,7 @@ jobs:
- name: Deploy to neocities
uses: bcomnes/deploy-to-neocities@master # dont use master in production
with:
api_key: ${{ secrets.NEOCITIES_API_TOKEN }}
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
cleanup: true
dist_dir: public
protected_files: 'dropbox/*'
neocities_supporter: true # set this to true if you have a supporter account and want to bypass unsuported files filter.
preview_before_deploy: true

View File

@ -8,7 +8,7 @@ on:
required: true
env:
node_version: lts/*
node_version: 16
FORCE_COLOR: 1
concurrency: # prevent concurrent releases
@ -19,11 +19,11 @@ jobs:
version_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v3
with:
# fetch full history so things like auto-changelog work properly
fetch-depth: 0
- uses: actions/setup-node@v6
- uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED

View File

@ -12,12 +12,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [lts/*]
node: [16]
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v6
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm i

1
.gitignore vendored
View File

@ -5,4 +5,3 @@ public
node_modules
tmp_modules
package-lock.json
coverage

View File

@ -7,159 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v3.0.4](https://github.com/bcomnes/deploy-to-neocities/compare/v3.0.3...v3.0.4)
### Merged
- chore(deps): bump minimatch from 10.0.1 to 10.0.3 [`#224`](https://github.com/bcomnes/deploy-to-neocities/pull/224)
### Commits
- Merge pull request #225 from bcomnes/dependabot/npm_and_yarn/async-neocities-4.1.2 [`692b031`](https://github.com/bcomnes/deploy-to-neocities/commit/692b031118b324f3c28f2204ff18882edb9c53af)
- chore(deps): bump async-neocities from 4.1.1 to 4.1.2 [`a1ae452`](https://github.com/bcomnes/deploy-to-neocities/commit/a1ae452c40f056b6cead68ed5d914245860ab45e)
## [v3.0.3](https://github.com/bcomnes/deploy-to-neocities/compare/v3.0.2...v3.0.3) - 2025-06-01
### Merged
- Add my own website in README.md [`#222`](https://github.com/bcomnes/deploy-to-neocities/pull/222)
- chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 [`#217`](https://github.com/bcomnes/deploy-to-neocities/pull/217)
- chore(deps-dev): bump esbuild from 0.24.2 to 0.25.0 [`#213`](https://github.com/bcomnes/deploy-to-neocities/pull/213)
- chore(deps-dev): bump neostandard from 0.11.9 to 0.12.0 [`#211`](https://github.com/bcomnes/deploy-to-neocities/pull/211)
### Commits
- Update async-neocities [`51ec937`](https://github.com/bcomnes/deploy-to-neocities/commit/51ec937eb84fa6beae055593f8e286e7d49d1d1e)
- Merge pull request #221 from bcomnes/dependabot/npm_and_yarn/npm-run-all2-8.0.1 [`7c11b66`](https://github.com/bcomnes/deploy-to-neocities/commit/7c11b664c6b9ed5b7d72def8047f539b2f2205a9)
- More example comments [`5761b44`](https://github.com/bcomnes/deploy-to-neocities/commit/5761b44f4df0408697ca3c9438cf8f7ae8df9628)
## [v3.0.2](https://github.com/bcomnes/deploy-to-neocities/compare/v3.0.1...v3.0.2) - 2024-12-09
### Merged
- chore(deps): bump async-neocities from 4.0.4 to 4.1.0 [`#210`](https://github.com/bcomnes/deploy-to-neocities/pull/210)
## [v3.0.1](https://github.com/bcomnes/deploy-to-neocities/compare/v3.0.0...v3.0.1) - 2024-11-28
### Merged
- chore(deps): bump async-neocities from 4.0.3 to 4.0.4 [`#209`](https://github.com/bcomnes/deploy-to-neocities/pull/209)
- fixed a typo in README.md [`#208`](https://github.com/bcomnes/deploy-to-neocities/pull/208)
- chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 [`#207`](https://github.com/bcomnes/deploy-to-neocities/pull/207)
- Add my website https://jefbecker.com/ to the list. [`#206`](https://github.com/bcomnes/deploy-to-neocities/pull/206)
### Commits
- Update README.md [`15eb88d`](https://github.com/bcomnes/deploy-to-neocities/commit/15eb88d4831e8b3170195c1e2b468e8ab3a9703d)
## [v3.0.0](https://github.com/bcomnes/deploy-to-neocities/compare/v2.0.4...v3.0.0) - 2024-11-19
### Merged
- chore(deps-dev): bump npm-run-all2 from 6.2.6 to 7.0.1 [`#205`](https://github.com/bcomnes/deploy-to-neocities/pull/205)
### Commits
- **Breaking change:** Update to the latest async-neocities 4.0 [`7b14798`](https://github.com/bcomnes/deploy-to-neocities/commit/7b14798c892f2494466bc72d5402c85801f75341)
## [v2.0.4](https://github.com/bcomnes/deploy-to-neocities/compare/v2.0.3...v2.0.4) - 2024-10-07
### Merged
- chore(deps-dev): bump top-bun from 9.1.1 to 10.0.0 [`#202`](https://github.com/bcomnes/deploy-to-neocities/pull/202)
- chore(deps): bump @actions/core from 1.11.0 to 1.11.1 [`#203`](https://github.com/bcomnes/deploy-to-neocities/pull/203)
## [v2.0.3](https://github.com/bcomnes/deploy-to-neocities/compare/v2.0.2...v2.0.3) - 2024-10-03
### Merged
- chore(deps): bump @actions/core from 1.10.1 to 1.11.0 [`#201`](https://github.com/bcomnes/deploy-to-neocities/pull/201)
- Add my site to the readme [`#200`](https://github.com/bcomnes/deploy-to-neocities/pull/200)
- chore(deps-dev): bump top-bun from 8.0.2 to 9.0.1 [`#197`](https://github.com/bcomnes/deploy-to-neocities/pull/197)
- chore(deps-dev): bump top-bun from 7.3.4 to 8.0.0 [`#193`](https://github.com/bcomnes/deploy-to-neocities/pull/193)
- chore(deps): bump minimatch from 9.0.5 to 10.0.1 [`#192`](https://github.com/bcomnes/deploy-to-neocities/pull/192)
- Remove my hobby website from the website list [`#188`](https://github.com/bcomnes/deploy-to-neocities/pull/188)
- chore(deps-dev): bump esbuild from 0.20.2 to 0.21.0 [`#184`](https://github.com/bcomnes/deploy-to-neocities/pull/184)
### Commits
- Merge pull request #199 from bcomnes/dependabot/npm_and_yarn/esbuild-0.24.0 [`f2bd635`](https://github.com/bcomnes/deploy-to-neocities/commit/f2bd635f4250c0f0c3dbf2fbced0be3608c96f2d)
- chore(deps-dev): bump esbuild from 0.23.1 to 0.24.0 [`90e8a07`](https://github.com/bcomnes/deploy-to-neocities/commit/90e8a074cd8aef07020ac80fbc420ee0a4189615)
- Merge pull request #191 from bcomnes/dependabot/npm_and_yarn/esbuild-0.23.0 [`8999c71`](https://github.com/bcomnes/deploy-to-neocities/commit/8999c710228c8627186a5360a882117a20c16cc1)
## [v2.0.2](https://github.com/bcomnes/deploy-to-neocities/compare/v2.0.1...v2.0.2) - 2024-04-04
### Commits
- Clarify default branch situation in README [`1fcd576`](https://github.com/bcomnes/deploy-to-neocities/commit/1fcd576de99dc8f39086f7239bf22962f3b8e7ae)
## [v2.0.1](https://github.com/bcomnes/deploy-to-neocities/compare/v2.0.0...v2.0.1) - 2024-04-04
### Commits
- Update docs [`5a66259`](https://github.com/bcomnes/deploy-to-neocities/commit/5a66259a88059e84b1a3981aa88389854700f8a8)
## [v2.0.0](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.21...v2.0.0) - 2024-04-04
### Merged
- Added https://sacred.neocities.org [`#175`](https://github.com/bcomnes/deploy-to-neocities/pull/175)
- chore(deps-dev): bump esbuild from 0.19.12 to 0.20.0 [`#170`](https://github.com/bcomnes/deploy-to-neocities/pull/170)
- chore(deps): bump actions/setup-node from 3 to 4 [`#165`](https://github.com/bcomnes/deploy-to-neocities/pull/165)
### Fixed
- **Breaking change:** Update action runtime to node20 [`#174`](https://github.com/bcomnes/deploy-to-neocities/issues/174)
### Commits
- Merge pull request #179 from bcomnes/dependabot/npm_and_yarn/minimatch-9.0.4 [`d2622ae`](https://github.com/bcomnes/deploy-to-neocities/commit/d2622ae949a095974f8a3ffb695d70658a9911fa)
- chore(deps): bump minimatch from 9.0.3 to 9.0.4 [`0d910df`](https://github.com/bcomnes/deploy-to-neocities/commit/0d910dfd72d5c6a016940426f91622f84d1dbdca)
- Update README.md [`0ee4b4c`](https://github.com/bcomnes/deploy-to-neocities/commit/0ee4b4c3a5bbab316700252a7e41e758773e2737)
## [v1.1.21](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.20...v1.1.21) - 2023-12-02
### Merged
- chore(deps-dev): bump @siteup/cli from 4.0.1 to 5.0.0 [`#163`](https://github.com/bcomnes/deploy-to-neocities/pull/163)
- chore(deps): bump actions/setup-node from 3 to 4 [`#162`](https://github.com/bcomnes/deploy-to-neocities/pull/162)
### Commits
- Update node in actions and rebuild [`bad0c3f`](https://github.com/bcomnes/deploy-to-neocities/commit/bad0c3f21924f957bd2d41156f9ae9894e8d01a1)
## [v1.1.20](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.19...v1.1.20) - 2023-10-22
### Merged
- chore(deps-dev): bump @siteup/cli from 2.2.11 to 3.1.0 [`#161`](https://github.com/bcomnes/deploy-to-neocities/pull/161)
### Commits
- Update async-neocities to 2.1.6 [`f820123`](https://github.com/bcomnes/deploy-to-neocities/commit/f8201237291216a53f9c4dde35c46a65a8ea534d)
## [v1.1.19](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.18...v1.1.19) - 2023-09-30
### Merged
- chore(deps): bump @actions/core from 1.10.0 to 1.10.1 [`#159`](https://github.com/bcomnes/deploy-to-neocities/pull/159)
- Update neocities.yml [`#158`](https://github.com/bcomnes/deploy-to-neocities/pull/158)
- chore(deps): bump actions/checkout from 3 to 4 [`#157`](https://github.com/bcomnes/deploy-to-neocities/pull/157)
## [v1.1.18](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.17...v1.1.18) - 2023-08-31
### Merged
- chore(deps-dev): bump esbuild from 0.18.20 to 0.19.0 [`#154`](https://github.com/bcomnes/deploy-to-neocities/pull/154)
- Update README.md [`#153`](https://github.com/bcomnes/deploy-to-neocities/pull/153)
### Commits
- Neocities badge [`0827633`](https://github.com/bcomnes/deploy-to-neocities/commit/0827633ad88c495adaa304fb68bb1ef422973659)
- Merge pull request #152 from bcomnes/dependabot/npm_and_yarn/minimatch-9.0.3 [`6b85bf5`](https://github.com/bcomnes/deploy-to-neocities/commit/6b85bf5162547159b92547d1e79f96e5996d2e96)
- chore(deps): bump minimatch from 9.0.2 to 9.0.3 [`48dc557`](https://github.com/bcomnes/deploy-to-neocities/commit/48dc557fed2d40506be024f40ef9c4045d82781a)
## [v1.1.17](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.16...v1.1.17) - 2023-06-27
## [v1.1.17](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.16...v1.1.17)
### Commits

View File

@ -4,24 +4,21 @@
[![Actions Status](https://github.com/bcomnes/deploy-to-neocities/workflows/tests/badge.svg)](https://github.com/bcomnes/deploy-to-neocities/actions)
![Deploy to neocities](https://github.com/bcomnes/deploy-to-neocities/workflows/Deploy%20to%20neocities/badge.svg)
[![Marketplace link](https://img.shields.io/badge/github%20marketplace-deploy--to--neocities-brightgreen)](https://github.com/marketplace/actions/deploy-to-neocities)
[![Neocities][neocities-img]](https://deploy-to-neocities.neocities.org)
<center><img src="static/logo.png"></center>
Efficiently deploy a website to [Neocities][nc] using [Github actions](https://github.com/features/actions). Uses content aware diffing to only update files that changed.
Alternatively, you can use the bin helper in [async-neocities](https://github.com/bcomnes/async-neocities) to deploy to neocities locally from your own machine as well as in CI.
## Usage
```yaml
name: Deploy to neocities
# only run on changes to main. Use main or master depending on whatever your default branch is called.
# only run on changes to master
on:
push:
branches:
- main
- master
concurrency: # prevent concurrent deploys doing strange things
group: deploy-to-neocities
@ -32,29 +29,23 @@ jobs:
runs-on: ubuntu-latest
steps:
# The checkout step copies your repo into the action runner. Important!
- uses: actions/checkout@v4
- uses: actions/checkout@v3
# Set up any tools and build steps here
# This example uses a Node.js toolchain to build a site
# If you don't need Node.js to build your site, you can omit this.
- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v3
with:
node-version: lts/*
# If you have a different build process, replace this with your own build steps
- name: Install deps and build
run: |
npm i
npm run build
# When the dist_dir is ready, deploy it to neocities
# Here we deploy the folder named `public`
- name: Deploy to neocities
uses: bcomnes/deploy-to-neocities@v3
uses: bcomnes/deploy-to-neocities@v1
with:
api_key: ${{ secrets.NEOCITIES_API_TOKEN }}
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
cleanup: false
neocities_supporter: false # set this to true if you have a supporter account and want to bypass unsuported files filter.
preview_before_deploy: true # print a deployment plan prior to waiting for files to upload.
dist_dir: public
```
@ -69,7 +60,7 @@ You'll need the API token for your site. Go to:
https://neocities.org/settings/{{your-sitename}}#api_key
```
Retreive your site's API token from Neocities. In your GitHub repository, set a [secret][sec] called `NEOCITIES_API_TOKEN`. Set the `api_token` input on your `deploy-to-neocities` action to `${{ secrets.NEOCITIES_API_TOKEN }}` as in the example above. The setting (as of writing) lives in Repository > Settings > Security > Secrets and Variables > Actions > Repository secrets.
Get your site's API token. In your GitHub repository, set a [secret][sec] called `NEOCITIES_API_TOKEN`. Set the `api_token` input on your `deploy-to-neocities` action to `${{ secrets.NEOCITIES_API_TOKEN }}` as in the example above.
During your workflow, generate the files you want to deploy to [Neocities][nc] into a directory. Set this as the `dist_dir` directory in your workflow (the default is `public`). You can use any tools to generate your site that can be installed or brought into the Github actions environment.
@ -79,11 +70,9 @@ You most likely only want to run this on the `master` branch so that only change
### Inputs
- `api_key` (**REQUIRED**): The API token for your [Neocities][nc] website to deploy to.
- `dist_dir`: The directory to deploy to [Neocities][nc]. Default: `public`. Don't deploy your root repo directory (e.g. `./`). It contains `.git`, `.github` and other files that won't deploy properly to neocities. Keep it clean by keeping or building your site into a subdir and deploy that.
- `neocities_supporter`: Set this to `true` if you have a paid neocities account and want to bypass the [unsupported files filter](https://neocities.org/site_files/allowed_types).
- `api_token` (**REQUIRED**): The API token for your [Neocities][nc] website to deploy to.
- `dist_dir`: The directory to deploy to [Neocities][nc]. Default: `public`. Don't deploy your root repo directory (e.g. `./`). It contains `.git`, `.github` and other files that won't deploy properly to neocities. Keep it clean by keeping or building your site into a subdir and deploy that.
- `cleanup`: Boolean string (`true` or `false`). If `true`, `deploy-to-neocities` will destructively delete files found on [Neocities][nc] not found in your `dist_dir`. Default: `false`.
- `preview_before_deploy`: Boolean string (`true` or `false`). If `true`, `deploy-to-neocities` will print a preview of the files that will be uploaded and deleted. Default: `true`.
- `protected_files`: An optional glob string used to mark files as protected. Protected files are never cleaned up. Test this option out with `cleanup` set to false before relying on it. Protected files are printed when `cleanup` is set to true or false. Glob strings are processed by [minimatch](https://github.com/isaacs/minimatch) against remote neocities file paths. Protected files can still be updated.
### Outputs
@ -150,13 +139,6 @@ None.
- https://obspogon.neocities.org/
- https://profsugoi.neocities.org/
- https://github.com/tencurse/neocities ([10kph.neocities.org](https://10kph.neocities.org/))
- https://github.com/alephdfilms/neocities/ ([alephd.neocities.org](https://alephd.neocities.org/)]
- https://sacred.neocities.org/ (https://github.com/M-Valentino/sacredOS)
- https://lenp.net/ (https://github.com/Len42/web-site)
- <https://punkfairie.net> (<https://github.com/punkfairie/punkfairie-site>)
- https://github.com/jefbecker/jefbecker.com ([jefbecker.com](https://jefbecker.com))
- https://github.com/MymeType/personal-website ([mymetype.neocities.org](https://mymetype.neocities.org/))
- https://github.com/oceanthunder/oceanthunder.github.io ([oceanthunder.dev](https://www.oceanthunder.dev))
- [See more!](https://github.com/bcomnes/deploy-to-neocities/network/dependents)
- ...PR your site when you set it up!
@ -178,4 +160,3 @@ See [changelog.md](CHANGELOG.md)
[fd]: https://ghub.io/form-data
[nc]: https://neocities.org
[sec]: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
[neocities-img]: https://img.shields.io/website/https/siteup.neocities.org?label=neocities&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAGhlWElmTU0AKgAAAAgABAEGAAMAAAABAAIAAAESAAMAAAABAAEAAAEoAAMAAAABAAIAAIdpAAQAAAABAAAAPgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAAAueefIAAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJ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iC/E4IKSaiyMuX9OVT/Xh4f5tkn0R+Czc9MOdZzokHLGmuiLPr8qqViqKchqYObcmNvnCeLlajz9+uzGCAOpTiNVabN2+25ETWMAxVV1enzPEBS254X5GqWpsmHwqRkfP4OpdF8y/WmM4psJ3HIVuYMr7n/qwZz6uRp/xq4uQvuSxK4sTBgwfVjh07VH19veInWnW9+j11uDJdlebEj0zqaiC/gSum/gxN3QJOzCA6sIIDv2D0KlhdrWS9Jt2F9aU+FKQ7eeYKi3kaSaur4C29j98lE4P9XWg59z5OnXgDb7/1pvlOY7c5EbYKjug+RFTSeJ90pmi6N/O1KbiKeIqOtJFPhXl6m87OGae8hPoU8SSxaj7dMvahEeCiGUQjcm/LiHLCT8hbUsaGCKk2wqWWNxHykD1LA13kC9JHdmBBLf/D5H8By9d+IkwR5NMAAAAASUVORK5CYII=

View File

@ -4,32 +4,20 @@ branding:
icon: aperture
color: orange
inputs:
api_key: # api token for site to deploy to
description: 'Neocities API key for site to deploy to'
api_token: # api token for site to deploy to
description: 'Neocities API token for site to deploy to'
required: true
dist_dir:
description: 'Local folder to deploy to neocities'
default: 'public'
required: true
neocities_supporter:
description: 'Set to true if you are a Neocities supporter to bypass file type upload restrictions'
default: 'false'
required: true
cleanup:
description: Delete orphaned files on neocities that don't exist in distDir
default: 'false'
default: false
required: true
preview_before_deploy:
description: 'Set to true if you want to print deploy preview stats prior to deploying.'
default: 'true'
required: false
protected_files:
description: A glob string that prevents matched files from ever being deleted.
required: false
api_token: # api token for site to deploy to
description: 'Neocities API key for site to deploy to'
required: false
deprecationMessage: 'api_token is deprecated, use api_key instead'
runs:
using: 'node20'
main: 'dist/index.cjs'
using: 'node16'
main: 'dist/index.js'

53632
dist/index.cjs vendored

File diff suppressed because one or more lines are too long

7
dist/index.cjs.map vendored

File diff suppressed because one or more lines are too long

22574
dist/index.js vendored Normal file

File diff suppressed because one or more lines are too long

7
dist/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long

9039
dist/meta.json vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'
export default neostandard({
ignores: [
...resolveIgnoresFromGitignore(),
'dist'
],
})

113
index.js
View File

@ -1,84 +1,57 @@
import core from '@actions/core'
import {
NeocitiesAPIClient,
printDeployText,
printPreviewText,
printResultsErrorDump,
SimpleTimer
} from 'async-neocities'
import path from 'node:path'
import assert from 'node:assert'
import fs from 'node:fs/promises'
import { minimatch } from 'minimatch'
const core = require('@actions/core')
// const github = require('@actions/github')
const Neocities = require('async-neocities')
const path = require('path')
const ms = require('ms')
const assert = require('webassert').default
const fsp = require('fs').promises
const { minimatch } = require('minimatch')
const { stackWithCauses } = require('pony-cause')
async function run () {
const key = core.getInput('api_key') || core.getInput('api_token')
let cleanup
async function doDeploy () {
const token = core.getInput('api_token')
const distDir = path.join(process.cwd(), core.getInput('dist_dir'))
const cleanup = JSON.parse(core.getInput('cleanup'))
const neocitiesSupporter = JSON.parse(core.getInput('neocities_supporter'))
const previewDeploy = JSON.parse(core.getInput('preview_before_deploy'))
cleanup = JSON.parse(core.getInput('cleanup'))
const protectedFilesGlob = core.getInput('protected_files')
assert(typeof cleanup === 'boolean', '`cleanup` input must be a boolean "true" or "false"')
assert(typeof neocitiesSupporter === 'boolean', '`neocities_supporter` input must be a boolean "true" or "false"')
assert(typeof previewDeploy === 'boolean', '`preview_before_deploy` input must be a boolean "true" or "false"')
assert(typeof cleanup === 'boolean', 'Cleanup input must be a boolean "true" or "false"')
const stat = await fsp.stat(distDir)
assert(stat.isDirectory(), 'dist_dir must be a directory that exists')
const stat = await fs.stat(distDir)
const client = new Neocities(token)
assert(stat.isDirectory(), '`dist_dir` input must be a path to a directory that exists')
const client = new NeocitiesAPIClient(key)
if (previewDeploy) {
const previewTimer = new SimpleTimer()
console.log('Running deploy preview prior to deployment...\n\n')
const diff = await client.previewDeploy({
directory: distDir,
includeUnsupportedFiles: neocitiesSupporter,
protectedFileFilter: protectedFilesGlob ? minimatch.filter(protectedFilesGlob) : undefined
})
previewTimer.stop()
printPreviewText({
diff,
timer: previewTimer,
cleanup,
includeUnsupportedFiles: neocitiesSupporter
})
const deployOpts = {
cleanup,
statsCb: Neocities.statsHandler()
}
const deployTimer = new SimpleTimer()
console.log('Deploying to Neocities...')
if (protectedFilesGlob) deployOpts.protectedFileFilter = minimatch.filter(protectedFilesGlob)
const results = await client.deploy({
directory: distDir,
cleanup,
includeUnsupportedFiles: neocitiesSupporter,
protectedFileFilter: protectedFilesGlob ? minimatch.filter(protectedFilesGlob) : undefined
})
const stats = await client.deploy(distDir, deployOpts)
deployTimer.stop()
if (results.errors.length > 0) {
printResultsErrorDump({
results,
timer: deployTimer
})
core.setFailed('The deploy completed with errors.')
} else {
printDeployText({
results,
timer: deployTimer,
cleanup,
includeUnsupportedFiles: neocitiesSupporter
})
console.log(`Deployed to Neocities in ${ms(stats.time)}:`)
console.log(` Uploaded ${stats.filesToUpload.length} files`)
console.log(` ${cleanup ? 'Deleted' : 'Orphaned'} ${stats.filesToDelete.length} files`)
console.log(` Skipped ${stats.filesSkipped.length} files`)
console.log(` ${stats.protectedFiles.length} protected files:`)
if (stats.protectedFiles.length) {
console.log(stats.protectedFiles)
}
}
run().catch(err => {
console.log('Unexpected error/throw during deployment:\n\n')
console.dir(err, { colors: true, depth: 999 })
core.setFailed(err instanceof Error ? err.message : `An unexpected error occurred during deployment: ${err}`)
doDeploy().catch(err => {
console.error(stackWithCauses(err))
if (err.stats) {
console.log('Files to upload: ')
console.dir(err.stats.filesToUpload, { colors: true, depth: 999 })
if (cleanup) {
console.log('Files to delete: ')
console.dir(err.stats.filesToDelete, { colors: true, depth: 999 })
}
}
core.setFailed(err.message)
})

View File

@ -1,32 +1,33 @@
{
"name": "deploy-to-neocities",
"description": "Github Action to deplpoy a folder to Neocities.org",
"version": "3.0.4",
"version": "1.1.17",
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)",
"bugs": {
"url": "https://github.com/bcomnes/deploy-to-neocities/issues"
},
"dependencies": {
"@actions/core": "2.0.2",
"async-neocities": "4.1.2",
"minimatch": "10.1.1"
"@actions/core": "1.10.0",
"async-neocities": "2.1.5",
"minimatch": "9.0.2",
"ms": "2.1.3",
"pony-cause": "^2.1.4",
"webassert": "3.0.2"
},
"devDependencies": {
"@voxpelli/tsconfig": "^16.1.0",
"top-bun": "^10.0.0",
"@siteup/cli": "^2.0.0",
"auto-changelog": "^2.0.0",
"browser-sync": "^2.27.7",
"dependency-check": "^4.1.0",
"gh-release": "^7.0.0",
"npm-run-all2": "^8.0.1",
"neostandard": "^0.12.0",
"c8": "^10.0.0",
"esbuild": "~0.27.1",
"typescript": "~5.9.3"
"npm-run-all2": "^6.0.0",
"standard": "^17.0.0",
"esbuild": "^0.18.0"
},
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
"keywords": [],
"license": "MIT",
"main": "index.js",
"type": "module",
"private": true,
"repository": {
"type": "git",
@ -34,20 +35,24 @@
},
"scripts": {
"build": "npm run clean && run-p build:*",
"build:action": "rm -rf dist && esbuild index.js --bundle --platform=node --sourcemap=external --outdir=dist --metafile=dist/meta.json --out-extension:.js=.cjs",
"build:site": "tb --src . --dest public --ignore dist,coverage",
"dist-pkg": "echo \"{ \\\"type\\\": \\\"commonjs\\\" }\" > dist/package.json",
"build:action": "rm -rf dist && esbuild index.js --bundle --platform=node --target=node16 --sourcemap=external --outdir=dist",
"build:site": "siteup --src . --dest public",
"clean": "rm -rf public && mkdir -p public",
"release": "git push --follow-tags && gh-release -y",
"start": "npm run watch",
"test": "run-s test:*",
"test:lint": "eslint",
"test:tsc": "tsc",
"test:node": "c8 node --test",
"test:deps": "dependency-check . --no-dev --no-peer",
"test:standard": "standard",
"version": "run-s version:*",
"version:build": "npm run build:action && git add dist",
"version:changelog": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md",
"watch": "npm run clean && run-p watch:*",
"watch:serve": "browser-sync start --server 'public' --files 'public'",
"watch:site": "npm run build:site -- -w"
},
"standard": {
"ignore": [
"dist"
]
}
}

View File

@ -1,6 +1,5 @@
import assert from 'node:assert'
import test from 'node:test'
const tap = require('tap')
test('test', async _t => {
assert.ok(true)
tap.test('test', async t => {
t.ok(true)
})

View File

@ -1,14 +0,0 @@
{
"extends": "@voxpelli/tsconfig/node20.json",
"compilerOptions": {
"skipLibCheck": true
},
"include": [
"**/*"
],
"exclude": [
"node_modules",
"public",
"dist"
]
}