Skip to content

Commit

Permalink
refactor: removing choco; updating snapshots and doctor; tweaking CD
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Sep 19, 2024
1 parent d3ba8be commit 9b45f80
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 338 deletions.
97 changes: 3 additions & 94 deletions .github/workflows/publish-release-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish packages to public repositories
on:
workflow_call:
inputs:
wheelArtifactName:
artifactName:
required: true
type: string
description: "The github artifact holding the wheel file which will be published"
Expand All @@ -16,11 +16,6 @@ on:
default: true
type: boolean
description: "Publish to brew repository"
do_chocolatey:
required: false
default: true
type: boolean
description: "Publish to Chocolatey repository"
do_snap:
required: false
default: true
Expand All @@ -31,32 +26,6 @@ on:
default: true
type: boolean
description: "Publish to Winget repository"
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: "The release version that will be published (e.g. 0.1.0). Note this is not the tag version."
do_brew:
required: false
default: true
type: boolean
description: "Publish to brew repository"
do_chocolatey:
required: false
default: true
type: boolean
description: "Publish to Chocolatey repository"
do_winget:
required: false
default: true
type: boolean
description: "Publish to Winget repository"
do_snap:
required: false
default: true
type: boolean
description: "Publish to snap repository"

jobs:
publish-brew:
Expand All @@ -66,84 +35,24 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

# Download either via release or provided artifact
- name: Download wheel from release
if: ${{ github.event_name == 'workflow_dispatch' }}
run: gh release download v${{ inputs.release_version }} --pattern "*.whl" --dir dist
env:
GH_TOKEN: ${{ github.token }}

- name: Download wheel from artifact
if: ${{ github.event_name == 'workflow_call' }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.wheelArtifactName }}
path: dist

- name: Download macOS binary from release
if: ${{ github.event_name == 'workflow_dispatch' }}
run: gh release download ${{ inputs.release }} --pattern "*-brew.tar.gz" --dir dist
- name: Download binary artifact from release
run: gh release download v${{ inputs.release_version }} --pattern "*-brew.tar.gz" --dir dist
env:
GH_TOKEN: ${{ github.token }}

- name: Download macOS binary from artifact
uses: actions/download-artifact@v4
if: ${{ github.event_name == 'workflow_call' }}
with:
name: ${{ inputs.binaryArtifactName }}
path: dist

- name: Set Git user as GitHub actions
run: git config --global user.email "[email protected]" && git config --global user.name "github-actions"

- name: ls dist folder
run: ls -la dist

- name: Update homebrew cask
run: scripts/update-brew-cask.sh "dist/algokit*-py3-none-any.whl" "dist/algokit*-macos_arm64-brew.tar.gz" "dist/algokit*-macos_x64-brew.tar.gz" "algorandfoundation/homebrew-tap"
env:
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}

publish-chocolatey:
runs-on: windows-latest
if: ${{ inputs.do_chocolatey }}
steps:
- name: Checkout source code
uses: actions/checkout@v4

# Download either via release or provided artifact
- name: Download release
if: ${{ github.event_name == 'workflow_dispatch' }}
run: gh release download v${{ inputs.release_version }} --pattern "*.whl" --dir dist
env:
GH_TOKEN: ${{ github.token }}

- name: Download artifact
if: ${{ github.event_name == 'workflow_call' }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifactName }}
path: dist

- name: Update chocolatey files
id: update_chocolatey_files
run: scripts/update-chocolatey-package.ps1

- name: Build package
uses: crazy-max/ghaction-chocolatey@v2
with:
args: pack --version ${{ steps.update_chocolatey_files.outputs.version }} .\scripts\chocolatey\algokit\algokit.nuspec

- name: Set API key
uses: crazy-max/ghaction-chocolatey@v2
with:
args: apikey --api-key ${{ secrets.CHOCOLATEY_API_KEY }} -source https://push.chocolatey.org/

- name: Push package
uses: crazy-max/ghaction-chocolatey@v2
with:
args: push --source https://push.chocolatey.org/

publish-winget:
runs-on: windows-latest
if: ${{ inputs.do_winget }}
Expand Down
39 changes: 0 additions & 39 deletions scripts/chocolatey/algokit/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/chocolatey/algokit/algokit.nuspec

This file was deleted.

Binary file removed scripts/chocolatey/algokit/algorand-logo-512.png
Binary file not shown.
22 changes: 0 additions & 22 deletions scripts/chocolatey/algokit/tools/LICENSE.txt

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/chocolatey/algokit/tools/VERIFICATION.txt

This file was deleted.

53 changes: 0 additions & 53 deletions scripts/chocolatey/algokit/tools/chocolateyinstall.ps1

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/chocolatey/algokit/tools/chocolateyuninstall.ps1

This file was deleted.

38 changes: 0 additions & 38 deletions scripts/update-chocolatey-package.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions src/algokit/cli/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def doctor_command(*, copy_to_clipboard: bool) -> None:
["git", "--version"],
missing_help=(
[
"Git required to `run algokit init`; install via `choco install git` if using Chocolatey, ",
"Git required to `run algokit init`; install via `winget install -e --id Git.Git` if using winget, ",
"or via https://github.com/git-guides/install-git#install-git-on-windows",
]
if is_windows
Expand Down Expand Up @@ -103,7 +103,7 @@ def doctor_command(*, copy_to_clipboard: bool) -> None:
"npm": check_dependency(["npm" if not is_windows else "npm.cmd", "--version"]),
}
if is_windows:
service_outputs["chocolatey"] = check_dependency(["choco", "--version"])
service_outputs["winget"] = check_dependency(["winget", "--version"])
elif os_type == "Darwin":
service_outputs["brew"] = check_dependency(["brew", "--version"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
File ref: https://github.com/auth0/auth0-python/blob/master/auth0/authentication/token_verifier.py
"""


from __future__ import annotations

import json
Expand Down
Loading

0 comments on commit 9b45f80

Please sign in to comment.