[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: Refactor ACT for more thorough usage

* All required files in the same file by using .actrc
* Include example .secrets and .env
* Update README with usage
* Refactor actTest to make docker build steps optional with ENV

FoxxMD (Sep 27, 2024, 11:41 AM EDT) 5b8a8a74 005dae76

+79 -56
+3
.github/act/.actrc
··· 1 + --directory ../../ 2 + --env-file .github/act/.env 3 + --secret-file .github/act/.secrets
+1
.github/act/.env.example
··· 1 + NO_DOCKER_BUILD=true
+3
.github/act/.secrets.example
··· 1 + DOCKER_PASSWORD= 2 + DOCKER_USERNAME= 3 + GITHUB_TOKEN=
+14 -1
.github/act/README.md
··· 1 1 Testing GH Actions with [ACT] 2 2 3 + Need to have credentials in a [`.secrets` file](https://nektosact.com/usage/index.html#secrets), copy and rename [`.secrets.example`](./secrets.example) to `.secrets`, then fill out blank fields. Required for docker/metadata-action to read...something. Fails with `Parameter token or opts.auth is required` if they are not supplied. 4 + 5 + An ENV file can also be made by copy and renaming [`.env.example`](./env.example). Set `NO_DOCKER_BUILD=true` if you only want to test APP_VERSION and docker tags output. 6 + 7 + Run the following **from this directory** to make use of `.actrc` and proper working directoy. 8 + 3 9 ### Test Branch Push 4 10 5 11 ```shell ··· 7 13 ``` 8 14 9 15 10 - ### Test Tag Push 16 + ### Test Tag (Release) Push 11 17 12 18 ```shell 13 19 act -W '.github/act/actTest.yml' -e '.github/act/actTagEvent.json' 14 20 ``` 21 + 22 + 23 + ### Test Tag (Pre-Release) Push 24 + 25 + ```shell 26 + act -W '.github/act/actTest.yml' -e '.github/act/actTagPreEvent.json' 27 + ```
+1 -1
.github/act/actBranchEvent.json
··· 1 1 { 2 2 "ref": "refs/heads/master", 3 - "sha": "e80ad81f051e2ff29e73c0401ad9b89a1b32c3f7" 3 + "sha": "005dae76ab51799d3d55112738e301cb1af0dafd" 4 4 }
+6 -3
.github/act/actTagEvent.json
··· 1 1 { 2 - "ref": "refs/tags/0.8.0", 3 - "ref_name": "0.8.0", 4 - "sha": "0a1a94d9ad4efa373f8d34aace5e7f0a3fff42ad" 2 + "ref": "refs/tags/0.8.4", 3 + "ref_name": "0.8.4", 4 + "before": "0000000000000000000000000000000000000000", 5 + "after": "005dae76ab51799d3d55112738e301cb1af0dafd", 6 + "sha": "005dae76ab51799d3d55112738e301cb1af0dafd", 7 + "base_ref": "refs/heads/master" 5 8 }
+8
.github/act/actTagPreEvent.json
··· 1 + { 2 + "ref": "refs/tags/0.8.5-rc1", 3 + "ref_name": "0.8.5-rc1", 4 + "before": "0000000000000000000000000000000000000000", 5 + "after": "005dae76ab51799d3d55112738e301cb1af0dafd", 6 + "sha": "005dae76ab51799d3d55112738e301cb1af0dafd", 7 + "base_ref": "refs/heads/master" 8 + }
+35 -33
.github/act/actTest.yml
··· 1 1 name: Publish Docker image to Dockerhub 2 2 3 3 on: 4 + workflow_dispatch: 4 5 push: 5 6 branches: 6 7 - 'master' ··· 8 9 - '*.*.*' 9 10 # don't trigger if just updating docs 10 11 paths-ignore: 11 - - '**.md' 12 + - 'README.md' 13 + - '.github/**' 14 + - 'flatpak/**' 12 15 # use release instead of tags once version is correctly parsed 13 16 # https://github.com/docker/metadata-action/issues/422 14 17 # https://github.com/docker/metadata-action/issues/240 ··· 17 20 18 21 jobs: 19 22 20 - test: 23 + push_to_registry: 21 24 name: Build and push container images 25 + if: github.event_name != 'pull_request' 22 26 runs-on: ubuntu-latest 23 - # strategy: 24 - # fail-fast: false 25 - # matrix: 26 - # include: 27 - # - dockerfile: ./Dockerfile 28 - # suffix: '' 29 - # platforms: 'linux/amd64' 30 27 steps: 31 28 - name: Check out the repo 32 29 uses: actions/checkout@v4 ··· 46 43 echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV 47 44 echo "COMMIT_BRANCH=$branchName" >> $GITHUB_ENV 48 45 49 - # - name: Set push event short ref 50 - # run: | 51 - # shortEventRef=${github.event.push.ref:10} 52 - # echo "SHORT_REF=$shortEventRef" >> $GITHUB_ENV 53 - 54 46 - name: Check App Version 55 47 env: 56 48 # use release instead of tags once version is correctly parsed ··· 62 54 run: | 63 55 echo $APP_VERSION 64 56 65 - # - name: Extract metadata (tags, labels) for Docker 66 - # id: meta 67 - # uses: docker/metadata-action@v5 68 - # with: 69 - # # generate Docker tags based on the following events/attributes 70 - # # https://github.com/docker/metadata-action/issues/247#issuecomment-1511259674 for NOT is default branch, eventually 71 - # tags: | 72 - # type=raw,value=latest,enable={{endsWith(github.ref, 'master')}},suffix=${{ matrix.suffix }} 73 - # type=ref,event=branch,enable=${{ !endsWith(github.ref, 'master') }},suffix=${{ matrix.suffix }} 74 - # type=semver,pattern={{version}},suffix=${{ matrix.suffix }} 75 - # flavor: | 76 - # latest=false 57 + - name: Extract metadata (tags, labels) for Docker 58 + id: meta 59 + uses: docker/metadata-action@v5 60 + with: 61 + # generate Docker tags based on the following events/attributes 62 + # https://github.com/docker/metadata-action/issues/247#issuecomment-1511259674 for NOT is default branch, eventually 63 + tags: | 64 + type=edge 65 + 66 + # maybe re-enable branch-named tags in the futures 67 + #type=ref,event=branch,enable=${{ !endsWith(github.ref, 'master') }} 68 + 69 + # tag non-prelease as latest -- has a higher priority than regular tag so it shows first in registries 70 + type=match,pattern=\d.\d.\d$,priority=901 71 + 72 + # tag all semver (include pre-release) 73 + type=semver,pattern={{version}} 74 + # flavor: | 75 + # latest=false 77 76 78 77 - name: Set up QEMU 79 78 uses: docker/setup-qemu-action@v3 79 + id: qemu 80 + if: ${{ !env.NO_DOCKER_BUILD }} 80 81 81 - # - name: Set up Docker Buildx 82 - # uses: docker/setup-buildx-action@v3 82 + - name: Set up Docker Buildx 83 + uses: docker/setup-buildx-action@v3 84 + if: ${{ steps.qemu.outcome == 'success' }} 85 + continue-on-error: true 83 86 84 87 - name: Build and push Docker image 88 + if: ${{ steps.qemu.outcome == 'success' }} 85 89 env: 86 90 # use release instead of tags once version is correctly parsed 87 91 #APP_VERSION: ${{ github.event.release.tag_name }} ··· 95 99 # https://github.com/docker/build-push-action/issues/1026#issue-2041857786 96 100 build-args: | 97 101 APP_BUILD_VERSION=${{env.APP_VERSION}} 98 - file: ${{ matrix.dockerfile }} 99 102 push: false 100 - tags: mstest:latest 101 - #tags: ${{ steps.meta.outputs.tags }} 102 - #labels: ${{ steps.meta.outputs.labels }} 103 - #platforms: ${{ matrix.platforms }} 103 + tags: ${{ steps.meta.outputs.tags }} 104 + labels: ${{ steps.meta.outputs.labels }} 105 + platforms: linux/amd64,linux/arm64
+8 -18
.github/workflows/publishImage.yml
··· 43 43 if: github.event_name != 'pull_request' 44 44 runs-on: ubuntu-latest 45 45 needs: test 46 - strategy: 47 - fail-fast: false 48 - matrix: 49 - include: 50 - - dockerfile: ./Dockerfile 51 - suffix: '' 52 - platforms: 'linux/amd64,linux/arm64' 53 - # - dockerfile: ./alpine.Dockerfile 54 - # suffix: '-alpine' 55 - # platforms: 'linux/amd64,linux/arm64' 56 46 # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token 57 47 permissions: 58 48 packages: write ··· 95 85 # https://github.com/docker/metadata-action/issues/247#issuecomment-1511259674 for NOT is default branch, eventually 96 86 tags: | 97 87 type=edge 98 - type=ref,event=branch,enable=${{ !endsWith(github.ref, 'master') }} 88 + 89 + # maybe re-enable branch-named tags in the futures 90 + #type=ref,event=branch,enable=${{ !endsWith(github.ref, 'master') }} 99 91 100 92 # tag non-prelease as latest -- has a higher priority than regular tag so it shows first in registries 101 - type=semver,pattern={{major}}.{{minor}}.{{patch}},value=latest,priority=901 93 + type=match,pattern=\d.\d.\d$,priority=901 102 94 103 95 # tag all semver (include pre-release) 104 96 type=semver,pattern={{version}} 105 - flavor: | 106 - latest=false 107 - # suffix=${{ matrix.suffix }},onlatest=false 97 + # flavor: | 98 + # latest=false 108 99 109 100 - name: Set up QEMU 110 101 uses: docker/setup-qemu-action@v3 ··· 126 117 # https://github.com/docker/build-push-action/issues/1026#issue-2041857786 127 118 build-args: | 128 119 APP_BUILD_VERSION=${{env.APP_VERSION}} 129 - file: ${{ matrix.dockerfile }} 130 - push: ${{ !env.ACT}} 120 + push: ${{ !env.ACT }} 131 121 tags: ${{ steps.meta.outputs.tags }} 132 122 labels: ${{ steps.meta.outputs.labels }} 133 - platforms: ${{ matrix.platforms }} 123 + platforms: linux/amd64,linux/arm64