diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..2cc2ce5 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,63 @@ +name: Build + +on: [push] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/Iron + cache: 'pnpm' + + - name: Bundle project + run: | + pnpm install + pnpm run build + + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: mpv-cut + path: | + dist + + release: + needs: build + if: ${{ startsWith(github.ref, 'refs/tags/') }} + + runs-on: ubuntu-latest + + steps: + - name: Download + uses: actions/download-artifact@v4 + with: + name: mpv-cut + path: mpv-cut + + - name: Install zip + run: sudo apt-get install -y zip/* + + - name: Create archive + working-directory: ${{env.GITHUB_WORKSPACE}} + run: (cd mpv-cut && zip -r "$OLDPWD/mpv-cut.zip" .) + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + mpv-cut.zip + fail_on_unmatched_files: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index eb9cbe0..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,29 +0,0 @@ -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