Skip to content

Commit

Permalink
ci: fix chocolatey publishing (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar authored Jan 5, 2024
1 parent 59c379e commit bb4a82c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name: Publish

on:
workflow_dispatch:
inputs:
package:
description: 'Package to publish'
type: choice
required: true
default: 'all'
options:
- 'all'
- 'npm'
- 'aur'
- 'homebrew'
- 'chocolatey'
- 'docker'

release:
types: [released]

Expand Down Expand Up @@ -60,6 +74,7 @@ jobs:
npm:
runs-on: ubuntu-latest
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'npm'
needs: assets
permissions:
contents: read
Expand Down Expand Up @@ -109,6 +124,7 @@ jobs:

aur:
runs-on: ubuntu-latest
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'aur'
needs: assets
steps:
- uses: actions/checkout@v4
Expand All @@ -126,6 +142,7 @@ jobs:

homebrew:
runs-on: ubuntu-latest
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'homebrew'
needs: assets
steps:
- uses: actions/checkout@v4
Expand All @@ -141,20 +158,25 @@ jobs:

chocolatey:
runs-on: windows-latest
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'chocolatey'
needs: assets
steps:
- uses: actions/checkout@v4

- name: move packages/chocolatey to chocolatey
run: |
mv packages/chocolatey chocolatey
- name: Update checksum
run: |
echo "New Hash: ${{ needs.assets.outputs.checksum }}\n"
sed -i "s/checksum = '.*'/checksum = '${{ needs.assets.outputs.checksum }}'/g" packages/chocolatey/tools/chocolateyinstall.ps1
cat packages/chocolatey/tools/chocolateyinstall.ps1
sed -i "s/checksum = '.*'/checksum = '${{ needs.assets.outputs.checksum }}'/g" chocolatey/tools/chocolateyinstall.ps1
cat chocolatey/tools/chocolateyinstall.ps1
- name: Choco pack
uses: crazy-max/ghaction-chocolatey@v2
with:
args: pack packages/chocolatey/crowdin-cli.nuspec
args: pack chocolatey/crowdin-cli.nuspec

- name: Choco publish
uses: crazy-max/ghaction-chocolatey@v2
Expand All @@ -163,6 +185,7 @@ jobs:

docker:
runs-on: ubuntu-latest
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'docker'
needs: assets
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion packages/chocolatey/crowdin-cli.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<owners>crowdin</owners>
<title>Crowdin CLI (Portable)</title>
<authors>Crowdin</authors>
<projectUrl>https://github.com/crowdin/crowdin-cli</projectUrl>
<projectUrl>https://crowdin.github.io/crowdin-cli</projectUrl>
<iconUrl>https://support.crowdin.com/assets/logos/crowdin-dark-symbol.png</iconUrl>
<copyright>© Crowdin</copyright>
<licenseUrl>https://github.com/crowdin/crowdin-cli/blob/main/LICENSE</licenseUrl>
Expand Down

0 comments on commit bb4a82c

Please sign in to comment.