Skip to content

Commit

Permalink
add chocolatey workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marianina8 committed May 20, 2024
1 parent da26917 commit 0321d04
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 13 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/chocolatey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Chocolatey Deploy

on:
push:
tags:
- '*'

defaults:
run:
shell: bash

jobs:
chocolatey:
name: Deploy
runs-on: windows-latest
if: github.repository == 'marianina8/timetravel'
steps:
- name: Clone Repository
uses: actions/checkout@v4
- uses: oprypin/find-latest-tag@v1
with:
repository: ${{ github.repository }} # The repository to scan.
releases-only: true # We know that all relevant tags have a GitHub release for them.
id: latesttag
- name: Set Checksum
run: |
filename="timetravel.exe"
url="https://github.com/${{ github.repository }}/releases/download/${{ steps.latesttag.outputs.tag }}/${filename}"
sed -i "s#{URL64}#${url}#g" "Assets/Choco/timetravel/tools/chocolateyinstall.ps1"
curl -sSL "${url}" -o "Assets/Choco/${filename}"
sha256=$(cat "Assets/Choco/${filename}" | sha256sum -)
sed -i "s/{SHA256CHECKSUM64}/${sha256:0:64}/g" "Assets/Choco/timetravel/tools/chocolateyinstall.ps1"
- name: Set Version
id: version
run: |
version=${{ steps.latesttag.outputs.tag }}
echo "nuget=$version" >> $GITHUB_OUTPUT
sed -i "s/{VERSION}/${version}/g" "Assets/Choco/timetravel/timetravel.nuspec"
- name: Choco Downgrade
uses: crazy-max/ghaction-chocolatey@v3
with:
args: install chocolatey --version=1.2.1 --allow-downgrade -y -r --no-progress
- name: Pack Release
uses: crazy-max/ghaction-chocolatey@v3
with:
args: pack Assets/Choco/timetravel/timetravel.nuspec --outputdirectory Assets/Choco/timetravel
- name: Choco Upgrade
uses: crazy-max/ghaction-chocolatey@v3
with:
args: upgrade chocolatey
- name: Upload Release
uses: crazy-max/ghaction-chocolatey@v3
with:
args: push Assets/Choco/timetravel/timetravel.${{ steps.version.outputs.nuget }}.nupkg -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_KEY }}
13 changes: 0 additions & 13 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,6 @@ brews:
commit_author:
name: marianina8

chocolateys:
- name: timetravel
description: A CLI tool for time travel
version: {{.Version}}
title: timetravel
tags: cli, golang, timetravel
project_url: https://github.com/marianina8/timetravel
maintainers:
- name: marianina8
email: mmontagnino@gmail.com
authors:
- marianina8

nfpms:
- formats:
- rpm
Expand Down

0 comments on commit 0321d04

Please sign in to comment.