From 02e4f27f12ef05e991b0d217662d45745bd55917 Mon Sep 17 00:00:00 2001 From: f0e <7321764+f0e@users.noreply.github.com> Date: Thu, 18 Jan 2024 23:16:41 +1000 Subject: [PATCH] ci: fix release workflow --- .github/workflows/build.yaml | 50 +++++++++++++++++++++++ .github/workflows/release.yaml | 74 +++++++++++++++++++++------------- 2 files changed, 95 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..eb07bc7 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,50 @@ +name: Build + +on: [push] + +env: + is_tag: ${{ startsWith(github.ref, 'refs/tags/') }} + +jobs: + publish: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['lts'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Bundle project + run: | + pnpm install + pnpm run build + + - name: Install zip + run: sudo apt-get install -y zip + + - name: Create archive + working-directory: ${{env.GITHUB_WORKSPACE}} + run: zip -r mpv-cut.zip dist + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: mpv-cut + path: | + mpv-cut.zip + + - name: Release + uses: softprops/action-gh-release@v1 + if: ${{ env.is_tag == 'true' }} + with: + files: | + mpv-cut.zip + fail_on_unmatched_files: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index eb9cbe0..2f06e0a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,29 +1,45 @@ -name: Create Release - -on: - push: - tags: - - '*' - -permissions: - contents: write - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install zip - run: sudo apt-get install -y zip - - - name: Create archive - working-directory: ${{env.GITHUB_WORKSPACE}} - run: zip -r mpv-cut.zip scripts script-opts - - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: | - mpv-cut.zip - fail_on_unmatched_files: true +name: Create Release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + publish: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['lts'] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Bundle project + run: | + pnpm install + pnpm run build + + - name: Install zip + run: sudo apt-get install -y zip + + - name: Create archive + working-directory: ${{env.GITHUB_WORKSPACE}} + run: zip -r mpv-cut.zip dist + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + mpv-cut.zip + fail_on_unmatched_files: true