Github Action to deploy files to github release
npm install upload-to-github-releaseyml
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.md"
tags: true
draft: true
`
You can find more samples on https://github.com/xresloader/upload-to-github-release-test/blob/master/.github/workflows/ .
Environments
$3
Optional The github token. You can set it to ["${{ secrets.GITHUB_TOKEN }}"][1] to use default token.
See https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line for details.
Inputs
$3
Required The files or file patterns to upload. You can upload multiple files by split them by semicolon. You can use the glob pattern to find the files.
$3
Optional The files or file patterns to delete before uploading new files. You can delete multiple files by split them by semicolon. You can use the glob pattern to find the files.
$3
Optional If you need to overwrite existing files, add overwrite: true.
Default : false
$3
Optional The resultant deployment is a draft Release that only repository collaborators can see. This gives you an opportunity to examine and edit the draft release.
This is a tristate option. It can be either true or false, which will set the release's status accordingly. When uploading to an existing release, you can also leave this option unset, which will perserve the release's existing status.
Default : true for new release, unset for existing release
We will only try to query the first 100 releases to find the draft release with the same name, because we can not get a draft release by tag name util it's published.
$3
Optional The resultant deployment is a Prerelease that only repository collaborators can see. This gives you an opportunity to examine and edit the prerelease.
This is a tristate option. It can be either true or false, which will set the release's status accordingly. When uploading to an existing release, you can also leave this option unset, which will perserve the release's existing status.
Default : false for new release, unset for existing release
$3
Optional With tags: true, your Releases deployment will trigger if and only if the build is a tagged build.
Default : false
$3
Optional Only work on these branches, set to nothing to accept all branches.
Default : []
$3
Optional Set custom tag name.
Default : ""
$3
Optional With update_latest_release: true, this action will try to update latest release first.
Default : false
$3
Optional Print the verbose logs to debug.
Default : false
$3
Optional Set release id to update.If release_id is set, this step will fail if we can not find it.
Default : 0
$3
Optional Set release name when create a new release.
Default : Git tag name
$3
Optional Set release body when create a new release.Not needed if using default_release_body_path.
Default : ""
$3
Optional Set the file to read release body when create a new release.Not needed if using default_release_body.
Default : ""
$3
Optional Always update release body when it's not empty.
Default : ""
$3
Optional Always update release body from file.Not needed if using update_release_body.
Default : ""
$3
Optional Append content instead of replace release body when updating.
Default : "false"
$3
Optional Authorized secret GitHub Personal Access Token. Defaults to github.token.
Default : ${{ github.token }}
$3
Optional Set the owner of target repository.
Default : current user/origanization
$3
Optional Set target repository.
Default : current repository
Outputs
$3
The release id.
$3
The release name.
$3
The release url.
$3
The release tag name.
$3
The release commitish.
For Developer
We can use [npm][3] or [yarn][4] to build this action.
`bash
npm i -g yarn
yarn install # or pnpm install
yarn run build # or pnpm run build
commit
git add lib/ src/
git commit -m "COMMIT MESSAGE"
`
`bash
test with bash
env NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" yarn run test
env NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules" pnpm run test
`
`powershell
test with powershell
$ENV:NODE_OPTIONS="$ENV:NODE_OPTIONS --experimental-vm-modules"
yarn run test # or pnpm run test
``