Skip to content

Commit

Permalink
Merge pull request #38 from Akaizoku/release-action
Browse files Browse the repository at this point in the history
Add automated release assets management
  • Loading branch information
Akaizoku authored Nov 21, 2024
2 parents d894a81 + bbfb9c6 commit 46a1629
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 46a1629

Please sign in to comment.