From 78df8c5fd30b4a1781e8086aaca0ec37035532f5 Mon Sep 17 00:00:00 2001 From: Binhao Qian Date: Fri, 5 Apr 2024 19:23:00 +0800 Subject: [PATCH] add release scripts. --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 76 +++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4200ff4..b1737c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: Build -on: [ workflow_dispatch ] +on: workflow_dispatch env: APP_VERSION: '0.2.0' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c11330b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,76 @@ +name: Release + +on: workflow_dispatch + +env: + APP_VERSION: '0.2.0' + +jobs: + build-win-x64: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + - run: npm install + - name: Build Windows + run: npm run build + - name: Package Windows + run: npm run pack-win + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Artifact - Windows + uses: softprops/action-gh-release@v2 + #if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: v${{ env.APP_VERSION }} + files: | + release/m3u8downloader-v${{ env.APP_VERSION }}-win32-x64.zip + + build-mac-x64: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + - run: npm install + - name: Build MacOS + run: npm run build + - name: Package MacOS + run: npm run pack-mac + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Artifact - MacOS + uses: softprops/action-gh-release@v2 + #if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: v${{ env.APP_VERSION }} + files: | + release/m3u8downloader-v${{ env.APP_VERSION }}-darwin-x64.dmg + + build-linux-x64: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + - run: npm install + - name: Build Linux + run: npm run build + - name: Package Linux + run: npm run pack-linux + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Artifact - Linux + uses: softprops/action-gh-release@v2 + #if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: v${{ env.APP_VERSION }} + files: | + release/m3u8downloader-v${{ env.APP_VERSION }}-linux-x64.tar.gz