From 4eec8bb7896002011c0c983efbb6104d419c9f16 Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto <39424834+matthewstrasiotto@users.noreply.github.com> Date: Sat, 18 Jun 2022 22:48:44 +1000 Subject: [PATCH] Revert "Revert "Add github action for publishing releases"" This reverts commit e3efd97964e503d41aa018309c0b9fddcc52adb5. --- .github/workflows/publish-nightly.yml | 62 +++++++++++++++++++++++++++ .github/workflows/publish.yml | 48 +++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 .github/workflows/publish-nightly.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish-nightly.yml b/.github/workflows/publish-nightly.yml new file mode 100644 index 0000000..daec118 --- /dev/null +++ b/.github/workflows/publish-nightly.yml @@ -0,0 +1,62 @@ +name: Publish Nightly + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build Dotnet + run: dotnet build --no-restore --warnaserror + - name: "Flag as nightly in build.yaml" + uses: fjogeleit/yaml-update-action@v0.10.0 + with: + valueFile: 'build.yaml' + propertyPath: 'version' + value: "0.0.0.9000" + commitChange: false + updateFile: true + - name: "JPRM: Build" + id: jrpm + uses: oddstr13/jellyfin-plugin-repository-manager@master + with: + version: "0.0.0.9000" + verbosity: debug + path: . + dotnet-target: "net6.0" + output: _dist + - name: Publish output artifacts + id: publish-assets + uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa + with: + prerelease: false + fail_on_unmatched_files: true + tag_name: nightly + files: | + _dist/* + build.yaml + body: | + Nightly build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish Plugin Manifest + uses: matthewstrasiotto/jellyfin-plugin-repo-action@dev-working + with: + ignorePrereleases: false + githubToken: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + pagesBranch: manifest-release + pagesFile: manifest.json + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..59fe9c5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Publish Release + +on: + release: + types: + - released + workflow_dispatch: + +jobs: + build: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/build.yaml@master + with: + dotnet-version: "6.0.*" + dotnet-target: "net6.0" + upload: + runs-on: ubuntu-latest + needs: + - build + steps: + - name: Download Artifact + uses: actions/download-artifact@v2.1.0 + with: + name: build-artifact + - name: Prepare GitHub Release assets + run: |- + for file in ./*; do + md5sum ${file#./} >> ${file%.*}.md5 + sha256sum ${file#./} >> ${file%.*}.sha256 + done + ls -l + - name: Upload GitHub Release assets + uses: shogo82148/actions-upload-release-asset@v1.5.0 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./* + generate: + runs-on: ubuntu-latest + needs: + - upload + steps: + - name: Publish Plugin Manifest + uses: matthewstrasiotto/jellyfin-plugin-repo-action@dev-working + with: + ignorePrereleases: false + githubToken: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + pagesBranch: manifest-release + pagesFile: manifest.json