Skip to content

Commit

Permalink
init project.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 28, 2024
0 parents commit 620e503
Show file tree
Hide file tree
Showing 13 changed files with 38,298 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ko_fi: jaywcjlove
buy_me_a_coffee: jaywcjlove
custom: ["https://www.paypal.me/kennyiseeyou", "https://jaywcjlove.github.io/#/sponsor"]
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: test
on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm install
- run: npm run build
- run: mkdir -p build

- name: Create idoc config
run: |
cat > idoc.yml << EOF
site: "Folder Tree {{version}}"
menus:
Home: index.html
Sponsor: https://jaywcjlove.github.io/#/sponsor
footer: |
<a href="https://jaywcjlove.github.io/#/sponsor" target="_blank">Sponsor</a> •
<a href="https://jaywcjlove.github.io/changelog-generator" target="_blank">Changelog Generator</a> •
<a href="https://jaywcjlove.github.io/create-tag-action" target="_blank">Create Tag</a> •
<a href="https://jaywcjlove.github.io/github-action-contributors" target="_blank">Contributors</a> •
<a href="https://jaywcjlove.github.io/generated-badges" target="_blank">Generated Badges</a>
<br />
Released under the MIT License. Copyright © {{idocYear}} Kenny Wong<br />
Generated by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a> v{{idocVersion}}
EOF
- run: npm install idoc@1 -g
- run: idoc
- name: gh-pages README.md
working-directory: dist
run: |
cat > README.md << EOF
Website: https://jaywcjlove.github.io/github-action-folder-tree
EOF
- name: Is a tag/release created auto?
id: create_tag
uses: jaywcjlove/create-tag-action@main
with:
# test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
package-path: ./package.json

- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@main

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
head-ref: ${{steps.create_tag.outputs.version}}
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- name: Create Release
uses: jaywcjlove/create-tag-action@main
with:
# test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
package-path: ./package.json
release: true
body: |
[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/github-action-upload-assets/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
```yml
- name: Print Folder Tree
uses: jaywcjlove/github-action-upload-assets@main
with:
asset-path: test.*
```
- run: echo "Hello World" > test.txt
- name: Compress test Example.
run: zip -r -y test.zip test.txt -x "node_modules/*"

- name: Release Upload Assets
# uses: jaywcjlove/github-action-upload-assets@main
if: steps.create_tag.outputs.successful == 'true'
uses: ./
with:
asset-path: test.*


28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
build
lib
node_modules

npm-debug.log*
lerna-debug.log
yarn-error.log
package-lock.json

.DS_Store
.cache
.vscode
.idea
.env

*.mpassword
*.bak
*.tem
*.temp
#.swp
*.*~
~*.*

# IDEA
*.iml
*.ipr
*.iws
.idea/
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npx --no lint-staged
git add dist/
5 changes: 5 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.ts": [
"npm run build"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 小弟调调™

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Release Upload Assets
===

[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
[![CI](https://github.com/jaywcjlove/github-action-upload-assets/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/github-action-upload-assets/actions/workflows/ci.yml)

GitHub Action to upload multiple assets to a release

## Example Usage

```yml
- name: Release Upload Assets
uses: jaywcjlove/github-action-upload-assets@main
if: steps.create_tag.outputs.successful == 'true'
with:
asset-path: '["./target/release/sgo-*"]'
```
## Inputs
- `asset-path` The paths to the assets you want to upload as a JSON array. You can use a [glob](https://www.npmjs.com/package/glob) pattern.
- `tag` Specify the release tag name, for example: `v1.23.12`

## Outputs

- `browser_download_urls` The URL users can navigate to in order to download the uploaded asset

## See Also

- [Github Release Changelog Generator](https://github.com/jaywcjlove/changelog-generator) A GitHub Action that compares the commit differences between two branches
- [Create Tags From](https://github.com/jaywcjlove/create-tag-action) Auto create tags from commit or package.json.
- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!
- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)
- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)
- [Github Action package](https://github.com/jaywcjlove/github-action-package) Read and modify the contents of `package.json`.
- [Github Action EJS](https://github.com/jaywcjlove/github-action-package) A github action to render a ejs template using github context.
- [Modify File Content](https://github.com/jaywcjlove/github-action-modify-file-content) Replace text content and submit content.

## License

Licensed under the MIT License.
27 changes: 27 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Release Upload Assets'
author: 'Kenny Wong'
description: 'GitHub Action to upload multiple assets to a release'
inputs:
token:
description: 'Your GITHUB_TOKEN'
default: ${{ github.token }}
required: false
asset-path:
description: 'The paths to the assets you want to upload as a JSON array. You can use a glob pattern.'
default: ''
required: true
tag:
description: "Specify the release tag name, for example: 'v1.23.12'"
default: ''
required: false
outputs:
browser_download_urls:
description: 'The URL users can navigate to in order to download the uploaded asset'

runs:
using: 'node20'
main: 'dist/index.js'

branding:
icon: 'file'
color: 'purple'
Loading

0 comments on commit 620e503

Please sign in to comment.