-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from Akaizoku/release-action
Add automated release assets management
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release Assets | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
compress: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository content | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
|
||
- name: Get repository name | ||
id: repo | ||
run: echo "::set-output name=name::$(basename $GITHUB_REPOSITORY)" | ||
|
||
- name: Get release version | ||
id: version | ||
run: echo "::set-output name=version::${{ github.event.release.tag_name }}" | ||
|
||
- name: Remove Git and GitHub-related files | ||
run: | | ||
rm -rf .git | ||
rm -rf .github | ||
- name: Compress repository content into ZIP file | ||
run: | | ||
zip -r ${{ steps.repo.outputs.name }}-v${{ steps.version.outputs.version }}.zip . | ||
- name: Upload ZIP file to release | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.repo.outputs.name }}-v${{ steps.version.outputs.version }}.zip | ||
asset_name: ${{ steps.repo.outputs.name }}-v${{ steps.version.outputs.version }}.zip | ||
asset_content_type: application/zip |