ci: Finalized corrected release workflow [skip ci]

This commit is contained in:
2024-12-21 16:52:29 -07:00
parent 7ed9cfa018
commit 844742053d
+160 -160
View File
@@ -311,190 +311,190 @@ jobs:
name: artifacts name: artifacts
path: artifacts path: artifacts
# publish-chocolatey-package: publish-chocolatey-package:
# needs: [publish-github-release] needs: [publish-github-release]
# name: Publish Chocolatey Package name: Publish Chocolatey Package
# runs-on: windows-latest runs-on: windows-latest
# steps: steps:
# - name: Checkout repository - name: Checkout repository
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 1 fetch-depth: 1
# - name: Get release artifacts - name: Get release artifacts
# uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
# with: with:
# name: artifacts name: artifacts
# path: artifacts path: artifacts
# - name: Set release assets and version - name: Set release assets and version
# shell: pwsh shell: pwsh
# run: | run: |
# # Read the first column from the SHA256 file # Read the first column from the SHA256 file
# $windows_sha = Get-Content ./artifacts/managarr-windows.sha256 | ForEach-Object { $_.Split(' ')[0] } $windows_sha = Get-Content ./artifacts/managarr-windows.sha256 | ForEach-Object { $_.Split(' ')[0] }
# Add-Content -Path $env:GITHUB_ENV -Value "WINDOWS_SHA=$windows_sha" Add-Content -Path $env:GITHUB_ENV -Value "WINDOWS_SHA=$windows_sha"
# # Read the release version from the release-version file # Read the release version from the release-version file
# $release_version = Get-Content ./artifacts/release-version $release_version = Get-Content ./artifacts/release-version
# Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_VERSION=$release_version" Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_VERSION=$release_version"
# - name: Validate release environment variables - name: Validate release environment variables
# run: | run: |
# echo "Release SHA windows: ${{ env.WINDOWS_SHA }}" echo "Release SHA windows: ${{ env.WINDOWS_SHA }}"
# echo "Release version: ${{ env.RELEASE_VERSION }}" echo "Release version: ${{ env.RELEASE_VERSION }}"
# - name: Package and Publish package to Chocolatey - name: Package and Publish package to Chocolatey
# run: | run: |
# mkdir ./deployment/chocolatey/tools mkdir ./deployment/chocolatey/tools
# # Run packaging script # Run packaging script
# python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/managarr.nuspec.template" "./deployment/chocolatey/managarr.nuspec" ${{ env.WINDOWS_SHA }} python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/managarr.nuspec.template" "./deployment/chocolatey/managarr.nuspec" ${{ env.WINDOWS_SHA }}
# python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/chocolateyinstall.ps1.template" "./deployment/chocolatey/tools/chocolateyinstall.ps1" ${{ env.WINDOWS_SHA }} python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/chocolateyinstall.ps1.template" "./deployment/chocolatey/tools/chocolateyinstall.ps1" ${{ env.WINDOWS_SHA }}
# # Publish to Chocolatey # Publish to Chocolatey
# cd ./deployment/chocolatey cd ./deployment/chocolatey
# choco pack choco pack
# echo y | choco install managarr -dv -s . echo y | choco install managarr -dv -s .
# $version = managarr --version $version = managarr --version
# $version = $version -replace " ", "." $version = $version -replace " ", "."
# choco push $version.nupkg -s https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }}; choco push $version.nupkg -s https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }};
# publish-homebrew-formula: publish-homebrew-formula:
# needs: [publish-github-release] needs: [publish-github-release]
# name: Update Homebrew formulas name: Update Homebrew formulas
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# - name: Checkout repository - name: Checkout repository
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 1 fetch-depth: 1
# - name: Get release artifacts - name: Get release artifacts
# uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
# with: with:
# name: artifacts name: artifacts
# path: artifacts path: artifacts
# - name: Set release assets and version - name: Set release assets and version
# shell: bash shell: bash
# run: | run: |
# # Set environment variables # Set environment variables
# macos_sha="$(cat ./artifacts/managarr-macos.sha256 | awk '{print $1}')" macos_sha="$(cat ./artifacts/managarr-macos.sha256 | awk '{print $1}')"
# echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV
# macos_sha_arm="$(cat ./artifacts/managarr-macos-arm64.sha256 | awk '{print $1}')" macos_sha_arm="$(cat ./artifacts/managarr-macos-arm64.sha256 | awk '{print $1}')"
# echo "MACOS_SHA_ARM=$macos_sha_arm" >> $GITHUB_ENV echo "MACOS_SHA_ARM=$macos_sha_arm" >> $GITHUB_ENV
# linux_sha="$(cat ./artifacts/managarr-linux-musl.sha256 | awk '{print $1}')" linux_sha="$(cat ./artifacts/managarr-linux-musl.sha256 | awk '{print $1}')"
# echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV
# release_version="$(cat ./artifacts/release-version)" release_version="$(cat ./artifacts/release-version)"
# echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
# - name: Validate release environment variables - name: Validate release environment variables
# run: | run: |
# echo "Release SHA macos: ${{ env.MACOS_SHA }}" echo "Release SHA macos: ${{ env.MACOS_SHA }}"
# echo "Release SHA macos-arm: ${{ env.MACOS_SHA_ARM }}" echo "Release SHA macos-arm: ${{ env.MACOS_SHA_ARM }}"
# echo "Release SHA linux musl: ${{ env.LINUX_SHA }}" echo "Release SHA linux musl: ${{ env.LINUX_SHA }}"
# echo "Release version: ${{ env.RELEASE_VERSION }}" echo "Release version: ${{ env.RELEASE_VERSION }}"
# - name: Execute Homebrew packaging script - name: Execute Homebrew packaging script
# run: | run: |
# # run packaging script # run packaging script
# python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/managarr.rb.template" "./managarr.rb" ${{ env.MACOS_SHA }} ${{ env.MACOS_SHA_ARM }} ${{ env.LINUX_SHA }} python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/managarr.rb.template" "./managarr.rb" ${{ env.MACOS_SHA }} ${{ env.MACOS_SHA_ARM }} ${{ env.LINUX_SHA }}
# - name: Push changes to Homebrew tap - name: Push changes to Homebrew tap
# env: env:
# TOKEN: ${{ secrets.MANAGARR_GITHUB_TOKEN }} TOKEN: ${{ secrets.MANAGARR_GITHUB_TOKEN }}
# run: | run: |
# # push to Git # push to Git
# git config --global user.name "Dark-Alex-17" git config --global user.name "Dark-Alex-17"
# git config --global user.email "alex.j.tusa@gmail.com" git config --global user.email "alex.j.tusa@gmail.com"
# git clone https://Dark-Alex-17:${{ secrets.MANAGARR_GITHUB_TOKEN }}@github.com/Dark-Alex-17/homebrew-managarr.git git clone https://Dark-Alex-17:${{ secrets.MANAGARR_GITHUB_TOKEN }}@github.com/Dark-Alex-17/homebrew-managarr.git
# rm homebrew-managarr/Formula/managarr.rb rm homebrew-managarr/Formula/managarr.rb
# cp managarr.rb homebrew-managarr/Formula cp managarr.rb homebrew-managarr/Formula
# cd homebrew-managarr cd homebrew-managarr
# git add . git add .
# git diff-index --quiet HEAD || git commit -am "Update formula for Managarr release ${{ env.RELEASE_VERSION }}" git diff-index --quiet HEAD || git commit -am "Update formula for Managarr release ${{ env.RELEASE_VERSION }}"
# git push https://$TOKEN@github.com/Dark-Alex-17/homebrew-managarr.git git push https://$TOKEN@github.com/Dark-Alex-17/homebrew-managarr.git
# publish-docker-image: publish-docker-image:
# needs: [publish-github-release] needs: [publish-github-release]
# name: Publishing Docker image to Docker Hub name: Publishing Docker image to Docker Hub
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# - name: Checkout repository - name: Checkout repository
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 1 fetch-depth: 1
# - name: Get release artifacts - name: Get release artifacts
# uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
# with: with:
# name: artifacts name: artifacts
# path: artifacts path: artifacts
# - name: Set version variable - name: Set version variable
# run: | run: |
# version="$(cat artifacts/release-version)" version="$(cat artifacts/release-version)"
# echo "version=$version" >> $GITHUB_ENV echo "version=$version" >> $GITHUB_ENV
# - name: Validate release environment variables - name: Validate release environment variables
# run: | run: |
# echo "Release version: ${{ env.version }}" echo "Release version: ${{ env.version }}"
# - name: Set up QEMU - name: Set up QEMU
# uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# - name: Login to Docker Hub - name: Login to Docker Hub
# uses: docker/login-action@v3 uses: docker/login-action@v3
# with: with:
# username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Push to Docker Hub - name: Push to Docker Hub
# uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
# with: with:
# context: . context: .
# file: Dockerfile file: Dockerfile
# platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
# push: true push: true
# tags: darkalex17/managarr:latest, darkalex17/managarr:${{ env.version }} tags: darkalex17/managarr:latest, darkalex17/managarr:${{ env.version }}
# publish-crate: publish-crate:
# needs: publish-github-release needs: publish-github-release
# name: Publish Crate name: Publish Crate
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# - name: Check if actor is repository owner - name: Check if actor is repository owner
# if: ${{ github.actor != github.repository_owner }} if: ${{ github.actor != github.repository_owner }}
# run: | run: |
# echo "You are not authorized to run this workflow." echo "You are not authorized to run this workflow."
# exit 1 exit 1
# - name: Checkout - name: Checkout
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 0 fetch-depth: 0
# - name: Ensure repository is up-to-date - name: Ensure repository is up-to-date
# run: | run: |
# git fetch --all git fetch --all
# git pull git pull
# - uses: actions/cache@v3 - uses: actions/cache@v3
# name: Cache Cargo registry name: Cache Cargo registry
# with: with:
# path: ~/.cargo/registry path: ~/.cargo/registry
# key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
# - uses: actions/cache@v3 - uses: actions/cache@v3
# with: with:
# path: ~/.cargo/bin path: ~/.cargo/bin
# key: ${{ runner.os }}-cargo-bin-${{ hashFiles('.github/workflows/release.yml') }} key: ${{ runner.os }}-cargo-bin-${{ hashFiles('.github/workflows/release.yml') }}
# - name: Install Rust stable - name: Install Rust stable
# uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
# - uses: katyo/publish-crates@v2 - uses: katyo/publish-crates@v2
# with: with:
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}