Skip to content

Commit

Permalink
chore: update configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMenoti committed Dec 18, 2024
1 parent e99e7b3 commit 6524b49
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 100 deletions.
122 changes: 61 additions & 61 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,67 +104,67 @@ jobs:
formula: azion
tag: ${{needs.build.outputs.binver}}

# publish-choco-package:
# runs-on: windows-latest
# needs: build
# steps:
# # Step 1: Check out the code
# - name: Checkout code
# uses: actions/checkout@v3

# # Step 2: Set up Chocolatey
# - name: Set up Chocolatey
# run: |
# Set-ExecutionPolicy Bypass -Scope Process -Force
# [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
# Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression

# # Step 3: Update version in azion.nuspec
# - name: Update version in azion.nuspec
# run: |
# $version = '${{ needs.build.outputs.binver }}'
# if (-Not $version) {
# Write-Error "Version is not defined! Check the output from bump_formula."
# exit 1
# }
# Write-Host "Updating nuspec version to $version"
# (Get-Content chocolatey/azion.nuspec) -replace '<version>.*</version>', "<version>$version</version>" | Set-Content chocolatey/azion.nuspec
# shell: pwsh

# # Step 4: Download the Azion executable
# - name: Download Azion executable
# run: |
# $toolsDir = "$(Resolve-Path .\chocolatey\tools)"
# New-Item -ItemType Directory -Force -Path $toolsDir | Out-Null
# $outputFile = Join-Path $toolsDir 'azion.exe'
# $url = 'http://downloads.azion.com/windows/x86_64/azion'
# Invoke-WebRequest -Uri $url -OutFile $outputFile
# shell: pwsh

# # Step 5: Calculate checksum
# - name: Calculate checksum
# id: calculate-checksum
# run: |
# $outputFile = "$(Resolve-Path .\chocolatey\tools\azion.exe)"
# $checksum = (Get-FileHash -Path $outputFile -Algorithm SHA256).Hash
# echo "::set-output name=checksum::$checksum"
# shell: pwsh

# # Step 6: Replace checksum in chocolateyinstall.ps1
# - name: Replace checksum in chocolateyinstall.ps1
# run: |
# (Get-Content .\chocolatey\tools\chocolateyinstall.ps1) -replace '{{CHECKSUM}}', '${{ steps.calculate-checksum.outputs.checksum }}' | Set-Content .\chocolatey\tools\chocolateyinstall.ps1
# shell: pwsh

# # Step 7: Pack and push the Chocolatey package
# - name: Publish Chocolatey package
# env:
# CHOCO_API_KEY: ${{ secrets.CHOCO_TOKEN }}
# run: |
# # Ensure that the Chocolatey package is packed and pushed correctly
# choco pack chocolatey/azion.nuspec
# choco push chocolatey/azion.${{ needs.build.outputs.binver }}.nupkg --source https://push.chocolatey.org/ --api-key $env:CHOCO_API_KEY
# shell: pwsh
publish-choco-package:
runs-on: windows-latest
needs: build
steps:
# Step 1: Check out the code
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Set up Chocolatey
- name: Set up Chocolatey
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
# Step 3: Update version in azion.nuspec
- name: Update version in azion.nuspec
run: |
$version = '${{ needs.build.outputs.binver }}'
if (-Not $version) {
Write-Error "Version is not defined! Check the output from bump_formula."
exit 1
}
Write-Host "Updating nuspec version to $version"
(Get-Content chocolatey/azion.nuspec) -replace '<version>.*</version>', "<version>$version</version>" | Set-Content chocolatey/azion.nuspec
shell: pwsh

# Step 4: Download the Azion executable
- name: Download Azion executable
run: |
$toolsDir = "$(Resolve-Path .\chocolatey\tools)"
New-Item -ItemType Directory -Force -Path $toolsDir | Out-Null
$outputFile = Join-Path $toolsDir 'azion.exe'
$url = 'http://downloads.azion.com/windows/x86_64/azion'
Invoke-WebRequest -Uri $url -OutFile $outputFile
shell: pwsh

# Step 5: Calculate checksum
- name: Calculate checksum
id: calculate-checksum
run: |
$outputFile = "$(Resolve-Path .\chocolatey\tools\azion.exe)"
$checksum = (Get-FileHash -Path $outputFile -Algorithm SHA256).Hash
echo "::set-output name=checksum::$checksum"
shell: pwsh

# Step 6: Replace checksum in chocolateyinstall.ps1
- name: Replace checksum in chocolateyinstall.ps1
run: |
(Get-Content .\chocolatey\tools\chocolateyinstall.ps1) -replace '{{CHECKSUM}}', '${{ steps.calculate-checksum.outputs.checksum }}' | Set-Content .\chocolatey\tools\chocolateyinstall.ps1
shell: pwsh

# Step 7: Pack and push the Chocolatey package
- name: Publish Chocolatey package
env:
CHOCO_API_KEY: ${{ secrets.CHOCO_TOKEN }}
run: |
# Ensure that the Chocolatey package is packed and pushed correctly
choco pack chocolatey/azion.nuspec
choco push chocolatey/azion.${{ needs.build.outputs.binver }}.nupkg --source https://push.chocolatey.org/ --api-key $env:CHOCO_API_KEY
shell: pwsh

Publish-to-WinGet:
runs-on: windows-latest
Expand Down
39 changes: 0 additions & 39 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,6 @@ nfpms:
file_info:
mode: 0644

chocolateys:
- name: azion

package_source_url: https://github.com/aziontech/azion/releases

owners: aziontech

title: azion

authors: PatrickMenoti

project_url: https://github.com/aziontech/azion

url_template: "http://downloads.azion.com/windows/x86_64/azion"

license_url: https://github.com/aziontech/azion/blob/dev/LICENSE

require_license_acceptance: false

project_source_url: https://github.com/aziontech/azion

docs_url: https://www.azion.com/en/documentation/products/azion-cli/overview

bug_tracker_url: https://github.com/aziontech/azion/issues

tags: "azion cli go publish deploy build jamstack"

summary: Use Azion CLI for managing Azion services via command-line.

description: Azion CLI is a user-friendly way to work with the Azion Edge Platform, allowing you to create and manage applications through simple commands.

release_notes: "https://github.com/aziontech/azion/releases/tag/{{ .Version }}"

api_key: "{{ .Env.CHOCOLATEY_TOKEN }}"

source_repo: "https://push.chocolatey.org/"

goamd64: v1

checksum:
name_template: "{{ .ProjectName }}_v{{ .Env.BIN_VERSION }}_checksum"
snapshot:
Expand Down

0 comments on commit 6524b49

Please sign in to comment.