Skip to content

Commit

Permalink
script for create archive
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Dec 5, 2021
1 parent dd046ab commit fd808be
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: build
on: [push, pull_request]
on:
push:
branches-ignore:
pull_request:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build_archive
on:
push:
branches-ignore:
- '**'
tags:
- '**'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
archive:
runs-on: ubuntu-latest
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
echo ::set-output name=plugin::$REPOSITORY
- uses: actions/checkout@v2
- name: Archive
run: |
cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: ${{ steps.version.outputs.version }}
body: ''
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.version.outputs.filename }}.zip
asset_name: ${{ steps.version.outputs.filename }}.zip
asset_content_type: application/zip

0 comments on commit fd808be

Please sign in to comment.