From f8e3d1ae8498d91fa9264ecf4f3a8ed0eefce6b8 Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Wed, 4 Sep 2024 13:36:35 +0200 Subject: [PATCH] chore: publish prereleases to another repository (#8732) * chore: publish prereleases to another repository move nightly/prereleases to https://github.com/containers/podman-desktop-prereleases repository fixes https://github.com/containers/podman-desktop/issues/8659 Signed-off-by: Florent Benoit --- .github/workflows/next-build.yaml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/next-build.yaml b/.github/workflows/next-build.yaml index 656317fdd63..ca9b35853f6 100644 --- a/.github/workflows/next-build.yaml +++ b/.github/workflows/next-build.yaml @@ -39,6 +39,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + token: ${{ secrets.PODMAN_DESKTOP_BOT_TOKEN }} + fetch-depth: 0 - name: Generate tag utilities id: TAG_UTIL run: | @@ -54,24 +57,31 @@ jobs: - name: tag run: | git config --local user.name ${{ github.actor }} + git config --local user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.desktopVersion }}\",#g" package.json find extensions/* -maxdepth 2 -name "package.json" | xargs -I {} sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.desktopVersion }}\",#g" {} + # change the repository field to be the prerelease repository in package.json file + sed -i "s#\"repository\":\ \"\(.*\)\",#\"repository\":\ \"https://github.com/containers/podman-desktop-prereleases\",#g" package.json cat package.json git add package.json extensions/*/package.json git commit -m "chore: tag ${{ steps.TAG_UTIL.outputs.githubTag }}" echo "Tagging with ${{ steps.TAG_UTIL.outputs.githubTag }}" git tag ${{ steps.TAG_UTIL.outputs.githubTag }} - git push origin ${{ steps.TAG_UTIL.outputs.githubTag }} + # push tag to the prereleases repository + git remote add prereleases https://github.com/containers/podman-desktop-prereleases + git push prereleases ${{ steps.TAG_UTIL.outputs.githubTag }} + - name: Create Release id: create_release uses: ncipollo/release-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag: ${{ steps.TAG_UTIL.outputs.githubTag }} name: ${{ steps.TAG_UTIL.outputs.githubTag }} draft: true prerelease: true + owner: containers + repo: podman-desktop-prereleases + token: ${{ secrets.PODMAN_DESKTOP_BOT_TOKEN }} build: name: Build / ${{ matrix.os }} @@ -85,6 +95,7 @@ jobs: steps: - uses: actions/checkout@v4 with: + repository: containers/podman-desktop-prereleases ref: ${{ needs.tag.outputs.githubTag}} - uses: pnpm/action-setup@v4 @@ -140,6 +151,8 @@ jobs: - name: Run Build timeout-minutes: 40 run: pnpm compile:next + env: + GITHUB_TOKEN: ${{ secrets.PODMAN_DESKTOP_BOT_TOKEN }} release: needs: [tag, build] @@ -152,9 +165,11 @@ jobs: - name: Publish release uses: StuYarrow/publish-release@v1.1.2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PODMAN_DESKTOP_BOT_TOKEN }} with: id: ${{ needs.tag.outputs.releaseId}} + repo: podman-desktop-prereleases + owner: containers publish: needs: [tag, release]