Github Action to deploy files to github release
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/ .
Required The github token. You can set it to "${{ secrets.GITHUB_TOKEN }}"
to use default token.
See https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line for details.
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.
Optional If you need to overwrite existing files, add overwrite: true.
Default : false
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.
Default : true
Optional The resultant deployment is a Prerelease that only repository collaborators can see. This gives you an opportunity to examine and edit the prerelease.
Default : false
Optional With tags: true, your Releases deployment will trigger if and only if the build is a tagged build.
Default : false
Optional Only work on these branches, set to nothing to accept all branches.
Default : []
The release name.
The release url.
The release tag name.
The release commitish.
We can use npm or yarn to build this action.
# for npm
npm install
npm run build
# for yarn
npm i -g yarn
yarn install
yarn run build
# commit
git add lib/* src/*
git commit -m "COMMIT MESSAGE"
title | link |
---|---|
GitHub Actions | https://github.com/features/actions |
Creating a javascript action | https://help.github.com/en/articles/creating-a-javascript-action#testing-out-your-action-in-a-workflow |
Events that trigger workflows - GitHub Help | https://help.github.com/en/articles/events-that-trigger-workflows |
The GitHub ToolKit for developing GitHub Actions | https://github.com/actions/toolkit |
GitHub GraphQL API v4 | https://developer.github.com/v4/ |
GitHub Rest API v3 for Release | https://developer.github.com/v3/repos/releases/ |
GitHub GraphQL API client for browsers and Node | https://github.com/octokit/graphql.js |
GitHub REST API client for JavaScript | https://octokit.github.io/rest.js/ |