From c0cc20a4edf6979aeffb0aab2d920f7d04843431 Mon Sep 17 00:00:00 2001 From: John Goodliff Date: Tue, 12 Nov 2024 21:31:36 -0700 Subject: [PATCH] Update archive-discover-weekly.yml to use new scripts --- .github/workflows/archive-discover-weekly.yml | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/archive-discover-weekly.yml b/.github/workflows/archive-discover-weekly.yml index a2401d6..84bfb59 100644 --- a/.github/workflows/archive-discover-weekly.yml +++ b/.github/workflows/archive-discover-weekly.yml @@ -17,21 +17,37 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.13' cache: 'pip' - name: Install Python deps run: pip install -r requirements.txt - - name: Run playlist archiver script + - name: Get playlist ID shell: bash env: SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }} SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }} SPOTIFY_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ACCESS_TOKEN }} SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }} + SPOTIFY_PLAYLIST_NAMES: 'Discover Weekly' 'Découvertes de la semaine' 'Découvertes hebdomadaires' 'Descubrimiento semanal' 'Descobertas da Semana' 'Descubrimiento semanal' 'اكتشف هذا الأسبوع' 'Открытиях недели' run: > - python playlist-archiver-for-spotify.py + echo "SPOTIFY_PLAYLIST_ID=$( + python get-playlist-id.py + "$SPOTIFY_CLIENT_ID" "$SPOTIFY_CLIENT_SECRET" + "$SPOTIFY_ACCESS_TOKEN" "$SPOTIFY_REFRESH_TOKEN" + ${SPOTIFY_PLAYLIST_NAMES} + )" >> $GITHUB_ENV + + - name: Copy playlist + shell: bash + env: + SPOTIFY_CLIENT_ID: ${{ secrets.SPOTIFY_CLIENT_ID }} + SPOTIFY_CLIENT_SECRET: ${{ secrets.SPOTIFY_CLIENT_SECRET }} + SPOTIFY_ACCESS_TOKEN: ${{ secrets.SPOTIFY_ACCESS_TOKEN }} + SPOTIFY_REFRESH_TOKEN: ${{ secrets.SPOTIFY_REFRESH_TOKEN }} + run: > + python copy-playlist.py "$SPOTIFY_CLIENT_ID" "$SPOTIFY_CLIENT_SECRET" "$SPOTIFY_ACCESS_TOKEN" "$SPOTIFY_REFRESH_TOKEN" - "Discover Weekly" "DW - %b %e" + "$SPOTIFY_PLAYLIST_ID" "DW - %b %e"