From 5f13819f5274681d710b7eb9bafacb2e4878f580 Mon Sep 17 00:00:00 2001 From: Haishan Date: Tue, 24 Nov 2020 11:22:53 +0800 Subject: [PATCH] ci: use actions/create-release for https://github.com/haishanh/yacd/issues/545 --- .github/workflows/push.yml | 27 ++++++++++++++++++++++++++- .gitignore | 6 ++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8b3df8c..4b54d71 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,7 +33,32 @@ jobs: - name: Build run: yarn build - ##### gh-pages + - name: Create Release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: true + prerelease: false + - name: Create Tar Ball + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + run: tar cJv yacd.tar.xz public + - name: Upload Release Asset + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + 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: ./yacd.tar.xz + asset_name: yacd.tar.xz + asset_content_type: application/x-gzip + - name: Push to gh-pages if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags/') || github.event.ref == 'refs/heads/publish') env: diff --git a/.gitignore b/.gitignore index b49271f..5c3420a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ *. !.eslintrc.yml +*.tar.gz +*.tar.xz +*.log +!.github node_modules/ public/ @@ -7,5 +11,3 @@ experimental/ deploy_ghpages.sh tags .eslintcache -*.log -!.github