Skip to content

Commit 285eef8

Browse files
committed
feat(ci): add distribution draft to homebrew/chocolatey tap
1 parent 7f3bd89 commit 285eef8

File tree

13 files changed

+360
-5
lines changed

13 files changed

+360
-5
lines changed
File renamed without changes.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Homebrew
2+
3+
## Formulae
4+
Invoke either of the following commands if the formula is hosted at GitHub
5+
6+
```sh
7+
$ brew install {{brewRepositoryOwner}}/{{brewRepositoryAlias}}/<formula>
8+
```
9+
10+
Or
11+
12+
```sh
13+
$ brew tap {{brewRepositoryOwner}}/{{brewRepositoryAlias}}
14+
$ brew install <formula>
15+
```
16+
17+
Invoke the following command if the formula is *not* hosted at GitHub
18+
19+
```sh
20+
brew tap {{brewRepositoryOwner}}/{{brewRepositoryName}} {{tapRepoCloneUrl}}
21+
brew install <formula>
22+
```
23+
24+
## Casks
25+
Invoke either of the following commands if the cask is hosted at GitHub
26+
27+
```sh
28+
$ brew install --cask {{brewRepositoryOwner}}/{{brewRepositoryAlias}}/<cask>
29+
```
30+
31+
Or
32+
33+
```sh
34+
$ brew tap {{brewRepositoryOwner}}/{{brewRepositoryAlias}}
35+
$ brew install --cask <cask>
36+
```
37+
38+
Invoke the following command if the cask is *not* hosted at GitHub
39+
40+
```sh
41+
brew tap {{brewRepositoryOwner}}/{{brewRepositoryName}} {{tapRepoCloneUrl}}
42+
brew install --cask <formula>
43+
```
44+
45+
If you get a dialog stating the cask is broken try installing with `--no-quarantine`.
46+
47+
## Documentation
48+
`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh).
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# {{jreleaserCreationStamp}}
2+
{{#brewRequireRelative}}
3+
require_relative "{{.}}"
4+
{{/brewRequireRelative}}
5+
6+
cask "{{brewCaskName}}" do
7+
desc "{{projectDescription}}"
8+
homepage "{{projectLinkHomepage}}"
9+
url "{{distributionUrl}}"{{#brewDownloadStrategy}}, :using => {{.}}{{/brewDownloadStrategy}},
10+
verified: "{{repoHost}}"
11+
version "{{projectVersion}}"
12+
sha256 "{{distributionChecksumSha256}}"
13+
name "{{brewCaskDisplayName}}"
14+
{{#brewCaskHasAppcast}}
15+
appcast {{brewCaskAppcast}}
16+
{{/brewCaskHasAppcast}}
17+
auto_updates true
18+
19+
{{#brewHasLivecheck}}
20+
livecheck do
21+
{{#brewLivecheck}}
22+
{{.}}
23+
{{/brewLivecheck}}
24+
end
25+
{{/brewHasLivecheck}}
26+
{{#brewDependencies}}
27+
depends_on {{.}}
28+
{{/brewDependencies}}
29+
30+
{{#brewCaskHasPkg}}
31+
pkg "{{brewCaskPkg}}"
32+
{{/brewCaskHasPkg}}
33+
{{#brewCaskHasApp}}
34+
app "{{brewCaskApp}}"
35+
{{/brewCaskHasApp}}
36+
{{#brewCaskHasBinary}}
37+
binary "{{distributionArtifactRootEntryName}}/bin/{{distributionExecutableUnix}}"
38+
{{/brewCaskHasBinary}}
39+
{{#brewCaskHasUninstall}}
40+
{{#brewCaskUninstall}}
41+
uninstall {{name}}: [
42+
{{#items}}
43+
"{{.}}",
44+
{{/items}}
45+
]
46+
{{/brewCaskUninstall}}
47+
{{/brewCaskHasUninstall}}
48+
{{#brewCaskHasZap}}
49+
{{#brewCaskZap}}
50+
zap {{name}}: [
51+
{{#items}}
52+
"{{.}}",
53+
{{/items}}
54+
]
55+
{{/brewCaskZap}}
56+
{{/brewCaskHasZap}}
57+
end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# {{jreleaserCreationStamp}}
2+
{{#brewRequireRelative}}
3+
require_relative "{{.}}"
4+
{{/brewRequireRelative}}
5+
6+
class {{brewFormulaName}} < Formula
7+
desc "{{projectDescription}}"
8+
homepage "{{projectLinkHomepage}}"
9+
version "{{projectVersion}}"
10+
license "{{projectLicense}}"
11+
12+
{{brewMultiPlatform}}
13+
14+
{{#brewHasLivecheck}}
15+
livecheck do
16+
{{#brewLivecheck}}
17+
{{.}}
18+
{{/brewLivecheck}}
19+
end
20+
{{/brewHasLivecheck}}
21+
{{#brewDependencies}}
22+
depends_on {{.}}
23+
{{/brewDependencies}}
24+
25+
def install
26+
libexec.install Dir["*"]
27+
bin.install_symlink "#{libexec}/bin/{{distributionExecutableUnix}}" => "{{distributionExecutableName}}"
28+
end
29+
30+
test do
31+
output = shell_output("#{bin}/{{distributionExecutableName}} --version")
32+
assert_match "{{projectVersion}}", output
33+
end
34+
end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# {{jreleaserCreationStamp}}
2+
{{#brewRequireRelative}}
3+
require_relative "{{.}}"
4+
{{/brewRequireRelative}}
5+
6+
class {{brewFormulaName}} < Formula
7+
desc "{{projectDescription}}"
8+
homepage "{{projectLinkHomepage}}"
9+
url "{{distributionUrl}}"{{#brewDownloadStrategy}}, :using => {{.}}{{/brewDownloadStrategy}}
10+
version "{{projectVersion}}"
11+
sha256 "{{distributionChecksumSha256}}"
12+
license "{{projectLicense}}"
13+
14+
{{#brewHasLivecheck}}
15+
livecheck do
16+
{{#brewLivecheck}}
17+
{{.}}
18+
{{/brewLivecheck}}
19+
end
20+
{{/brewHasLivecheck}}
21+
{{#brewDependencies}}
22+
depends_on {{.}}
23+
{{/brewDependencies}}
24+
25+
def install
26+
libexec.install Dir["*"]
27+
bin.install_symlink "#{libexec}/bin/{{distributionExecutableUnix}}" => "{{distributionExecutableName}}"
28+
end
29+
30+
test do
31+
output = shell_output("#{bin}/{{distributionExecutableName}} --version")
32+
assert_match "{{projectVersion}}", output
33+
end
34+
end
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Push-{{distributionName}}
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches-ignore:
8+
- '**'
9+
10+
jobs:
11+
push:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '5.0.x'
20+
21+
- name: Find package
22+
shell: bash
23+
run: |
24+
echo "PACKAGE_NAME=$(ls {{chocolateyPackageName}}/*.nuspec)" >> $GITHUB_ENV
25+
26+
- name: Pack
27+
shell: powershell
28+
run: |
29+
choco pack ${{=<% %>=}}{{ env.PACKAGE_NAME }}<%={{ }}=%>
30+
31+
- name: Publish
32+
shell: powershell
33+
run: |
34+
choco apikey -k ${{=<% %>=}}{{ secrets.CHOCOLATEY_API_KEY }}<%={{ }}=%> -s {{chocolateySource}}
35+
choco push $(ls *.nupkg | % {$_.FullName}) -s {{chocolateySource}}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Trigger-{{distributionName}}
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
trigger:
8+
runs-on: windows-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-dotnet@v4
14+
with:
15+
dotnet-version: '5.0.x'
16+
17+
- name: Find package
18+
shell: bash
19+
run: |
20+
echo "PACKAGE_NAME=$(ls {{distributionName}}/*.nuspec)" >> $GITHUB_ENV
21+
22+
- name: Pack
23+
shell: powershell
24+
run: |
25+
choco pack ${{=<% %>=}}{{ env.PACKAGE_NAME }}<%={{ }}=%>
26+
27+
- name: Publish
28+
shell: powershell
29+
run: |
30+
choco apikey -k ${{=<% %>=}}{{ secrets.CHOCOLATEY_API_KEY }}<%={{ }}=%> -s {{chocolateySource}}
31+
choco push $(ls *.nupkg | % {$_.FullName}) -s {{chocolateySource}}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- {{jreleaserCreationStamp}} -->
3+
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
4+
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
5+
<metadata>
6+
<!-- required -->
7+
<id>{{chocolateyPackageName}}</id>
8+
<version>{{chocolateyPackageVersion}}</version>
9+
<authors>{{projectAuthorsByComma}}</authors>
10+
<description>{{projectLongDescription}}</description>
11+
<!-- optional -->
12+
<title>{{chocolateyTitle}}</title>
13+
<projectUrl>{{projectLinkHomepage}}</projectUrl>
14+
<copyright>{{projectCopyright}}</copyright>
15+
<licenseUrl>{{projectLinkLicense}}</licenseUrl>
16+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
17+
<tags>{{distributionTagsBySpace}}</tags>
18+
<summary>{{projectDescription}}</summary>
19+
<projectSourceUrl>{{repoUrl}}</projectSourceUrl>
20+
<packageSourceUrl>{{chocolateyPackageSourceUrl}}</packageSourceUrl>
21+
<docsUrl>{{projectLinkDocumentation}}</docsUrl>
22+
<bugTrackerUrl>{{projectLinkBugTracker}}</bugTrackerUrl>
23+
<releaseNotes>{{releaseNotesUrl}}</releaseNotes>
24+
{{#chocolateyIconUrl}}<iconUrl>{{.}}</iconUrl>{{/chocolateyIconUrl}}
25+
</metadata>
26+
<files>
27+
<file src="tools\**" target="tools" />
28+
</files>
29+
</package>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# {{jreleaserCreationStamp}}
2+
$tools = Split-Path $MyInvocation.MyCommand.Definition
3+
$package = Split-Path $tools
4+
5+
Install-ChocolateyZipPackage `
6+
-PackageName '{{chocolateyPackageName}}' `
7+
-Url '{{distributionUrl}}' `
8+
-Checksum '{{distributionChecksumSha256}}' `
9+
-ChecksumType 'sha256' `
10+
-UnzipLocation $package
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__ __
2+
_________ ____ / /_/ /__ __________
3+
/ ___/ __ \/ __ \/ __/ / _ \/ ___/ ___/
4+
(__ ) /_/ / /_/ / /_/ / __(__ |__ )
5+
/____/ .___/\____/\__/_/\___/____/____/ Spotless CLI
6+
/_/
7+
8+
For detailed information on the Spotless CLI, see our github page
9+
10+
--> https://github.com/diffplug/spotless-cli <--

0 commit comments

Comments
 (0)