Skip to content

Commit

Permalink
Merge pull request #172 from ptr727/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ptr727 committed Jun 18, 2023
2 parents 818d93b + 843a01a commit 582a614
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/BuildDockerPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# env is not supported in matrix operations or job if :(
env:
# Do not push on pull_request events
dopush: ${{ github.event_name != 'pull_request' }}
# main branch
mainbranch: ${{ endsWith(github.ref, 'refs/heads/main') }}

jobs:

# Test
Expand Down Expand Up @@ -140,8 +147,7 @@ jobs:
# Login to Docker Hub
# https://github.com/marketplace/actions/docker-login
- name: Login to Docker Hub
# No need to login if not pushing
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ env.dopush }}
uses: docker/login-action@v2
with:
registry: docker.io
Expand All @@ -161,15 +167,14 @@ jobs:
cache-from: type=gha,scope=${{ matrix.cache-scope }}
cache-to: type=gha,mode=max,scope=${{ matrix.cache-scope }}
file: ${{ matrix.file }}
# Don't push pull requests
push: ${{ (github.event_name != 'pull_request') }}
# TODO: How to test for secret not null and avoid "null= is not a valid secret"
secrets: ${{ matrix.secrets }}=${{ secrets[matrix.secrets] }}
tags: ${{ matrix.tags }}
platforms: ${{ matrix.platforms }}
build-args: |
LABEL_VERSION=${{ needs.version.outputs.SemVer2 }}
BUILD_CONFIGURATION=${{ endsWith(github.ref, 'refs/heads/main') && 'Release' || 'Debug' }}
BUILD_CONFIGURATION=${{ env.mainbranch && 'Release' || 'Debug' }}
BUILD_VERSION=${{ needs.version.outputs.AssemblyVersion }}
BUILD_FILE_VERSION=${{ needs.version.outputs.AssemblyFileVersion }}
BUILD_ASSEMBLY_VERSION=${{ needs.version.outputs.AssemblyFileVersion }}
Expand All @@ -182,7 +187,7 @@ jobs:
name: Tool versions
runs-on: ubuntu-latest
needs: buildpush
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ github.event_name != 'pull_request' }}

strategy:

Expand Down Expand Up @@ -234,7 +239,7 @@ jobs:
name: Create README.md
runs-on: ubuntu-latest
needs: toolversions
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ github.event_name != 'pull_request' }}

steps:

Expand Down Expand Up @@ -267,7 +272,7 @@ jobs:
name: Update README.md
runs-on: ubuntu-latest
needs: updatereadme
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ github.event_name != 'pull_request' }}

steps:

Expand All @@ -292,7 +297,7 @@ jobs:
name: Date badge
runs-on: ubuntu-latest
needs: buildpush
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ github.event_name != 'pull_request' }}

steps:

Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/BuildGitHubRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# env is not supported in matrix operations or job if :(
env:
# Do not push on pull_request events
dopush: ${{ github.event_name != 'pull_request' }}
# main branch
mainbranch: ${{ endsWith(github.ref, 'refs/heads/main') }}

jobs:

# Test
Expand Down Expand Up @@ -109,7 +116,7 @@ jobs:
--runtime ${{ matrix.runtime }}
--self-contained false
--output ${{ runner.temp }}/publish/${{ matrix.runtime }}
--configuration ${{ endsWith(github.ref, 'refs/heads/main') && 'Release' || 'Debug' }}
--configuration ${{ env.mainbranch && 'Release' || 'Debug' }}
-property:Version=${{ needs.version.outputs.AssemblyVersion }}
-property:FileVersion=${{ needs.version.outputs.AssemblyFileVersion }}
-property:AssemblyVersion=${{ needs.version.outputs.AssemblyVersion }}
Expand All @@ -118,8 +125,7 @@ jobs:
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts
# No need to publish if artifacts if not publishing build
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ env.dopush }}
uses: actions/upload-artifact@v3
with:
name: publish
Expand All @@ -131,7 +137,7 @@ jobs:
name: Publish
runs-on: ubuntu-latest
needs: [ build, version ]
if: ${{ (github.event_name != 'pull_request') }}
if: ${{ github.event_name != 'pull_request' }}

steps:

Expand All @@ -154,5 +160,5 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: ${{ needs.version.outputs.SemVer2 }}
# Only main branch is not a pre-release
prerelease: ${{ !endsWith(github.ref, 'refs/heads/main') }}
prerelease: ${{ !env.mainbranch }}
files: ${{ runner.temp }}/publish/PlexCleaner.7z
10 changes: 5 additions & 5 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Images are updated weekly with the latest upstream updates.
### `ptr727/plexcleaner:latest`

```text
PlexCleaner: 3.1.42+10a9e38516 22:04:58 [INF] <1> Exit Code : 0
PlexCleaner: 3.1.45+4ed2d87c0f 23:43:41 [INF] <1> Exit Code : 0
dotNET: 7.0.304
HandBrakeCLI: HandBrake 20230223192356-5c2b5d2d0-1.6.x
MediaInfo: MediaInfo Command line, MediaInfoLib - v23.04
Expand All @@ -65,7 +65,7 @@ FfMpeg: ffmpeg version 6.0-0ubuntu1~22.04.sav1.1 Copyright (c) 2000-2023 the FFm
### `ptr727/plexcleaner:savoury`

```text
PlexCleaner: 3.1.42+10a9e38516 22:04:58 [INF] <1> Exit Code : 0
PlexCleaner: 3.1.45+4ed2d87c0f 23:43:41 [INF] <1> Exit Code : 0
dotNET: 7.0.304
HandBrakeCLI: HandBrake 20230223192356-5c2b5d2d0-1.6.x
MediaInfo: MediaInfo Command line, MediaInfoLib - v23.04
Expand All @@ -77,7 +77,7 @@ FfMpeg: ffmpeg version 6.0-0ubuntu1~22.04.sav1.1 Copyright (c) 2000-2023 the FFm
### `ptr727/plexcleaner:debian`

```text
PlexCleaner: 3.1.42+10a9e38516 22:04:56 [INF] <1> Exit Code : 0
PlexCleaner: 3.1.45+4ed2d87c0f 23:43:53 [INF] <1> Exit Code : 0
dotNET: 7.0.304
HandBrakeCLI: HandBrake 1.6.1
MediaInfo: MediaInfo Command line, MediaInfoLib - v23.04
Expand All @@ -89,7 +89,7 @@ FfMpeg: ffmpeg version 5.1.3-1 Copyright (c) 2000-2022 the FFmpeg developers bui
### `ptr727/plexcleaner:alpine`

```text
PlexCleaner: 3.1.42+10a9e38516 22:04:39 [INF] <1> Exit Code : 0
PlexCleaner: 3.1.45+4ed2d87c0f 23:43:22 [INF] <1> Exit Code : 0
dotNET: 7.0.304
HandBrakeCLI: HandBrake 1.6.1
MediaInfo: MediaInfo Command line, MediaInfoLib - v23.04
Expand All @@ -101,7 +101,7 @@ FfMpeg: ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers built w
### `ptr727/plexcleaner:arch`

```text
PlexCleaner: 3.1.42+10a9e38516 22:04:55 [INF] <1> Exit Code : 0
PlexCleaner: 3.1.45+4ed2d87c0f 23:43:55 [INF] <1> Exit Code : 0
dotNET: 7.0.105
HandBrakeCLI: HandBrake 1.6.1
MediaInfo: MediaInfo Command line, MediaInfoLib - v23.04
Expand Down
1 change: 1 addition & 0 deletions PlexCleaner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{CA5B
ProjectSection(SolutionItems) = preProject
.github\workflows\BuildDockerPush.yml = .github\workflows\BuildDockerPush.yml
.github\workflows\BuildGitHubRelease.yml = .github\workflows\BuildGitHubRelease.yml
.github\dependabot.yml = .github\dependabot.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlexCleanerTests", "PlexCleanerTests\PlexCleanerTests.csproj", "{D6124D3D-CC4F-448F-BF57-C1D7E2FAC226}"
Expand Down

0 comments on commit 582a614

Please sign in to comment.