Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix chocolatey publishing #699

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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