Skip to content

Commit

Permalink
Add chocolatey support
Browse files Browse the repository at this point in the history
  • Loading branch information
lynzrand committed Jun 12, 2020
1 parent 88996c2 commit 7ab2bf4
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,47 @@ jobs:
asset_name: "pacaptr.rb"
tag: ${{ github.ref }}
overwrite: true

# this scripts packs up a Chocolatey package and pushes it to Choco repository
publish-choco:
name: Publish app on Chocolatey
runs-on: windows-latest
needs: [publish-non-linux]
steps:
- name: Copy data to choco template
id: choco-data
run: cp ./target/release/${{ matrix.artifact_name }} ./dist/choco/tools

- name: Get "version"
id: ver
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Check "version"
env:
RELEASE_VERSION: ${{ steps.ver.outputs.tag }}
run: |
echo "Detected version:"
- name: Add license
run: cp LICENSE dist/choco/tools/

- name: Replace variables in template
uses: rami3l/bumper@master
id: replace
with:
template: "dist/choco/pacaptr.template.nuspec"
out: "dist/choco/pacaptr.nuspec"

rules: |
{
"version": "${{ steps.ver.outputs.tag }}",
}
- name: Set choco api key
run: choco apikey --key ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org

- name: Pack up NuGet package
run: choco pack dist/choco/pacaptr.nuspec

- name: Push to choco repository
run: choco push pacaptr.${{ steps.ver.outputs.tag }} --source https://push.chocolatey.org
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Choco files that should get ignored
ignore.*
56 changes: 56 additions & 0 deletions dist/choco/pacaptr.template.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>pacaptr</id>
<version>{version}</version>
<packageSourceUrl>https://github.com/rami3l/pacaptr</packageSourceUrl>
<owners>Rami3L</owners>
<!-- ============================== -->

<!-- == SOFTWARE SPECIFIC SECTION == -->
<!-- This section is about the software itself -->
<title>pacaptr (Install)</title>
<authors>Rami3L</authors>
<!-- projectUrl is required for the community feed -->
<projectUrl>https://github.com/rami3l/pacaptr</projectUrl>
<!--<iconUrl>http://cdn.rawgit.com/__REPLACE_YOUR_REPO__/master/icons/pacaptr.png</iconUrl>-->
<copyright>2020 Rami3L</copyright>
<!-- If there is a license Url available, it is required for the community feed -->
<licenseUrl>https://opensource.org/licenses/MIT</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/rami3l/pacaptr</projectSourceUrl>
<!--<docsUrl>At what url are the software docs located?</docsUrl>-->
<!--<mailingListUrl></mailingListUrl>-->
<bugTrackerUrl>https://github.com/rami3l/pacaptr/issues</bugTrackerUrl>
<tags>pacaptr pacman</tags>
<summary>Pacman syntax wrapper for homebrew, chocolatey, apt, and more.</summary>
<!-- <description>${description}</description> -->
<!-- <releaseNotes>__REPLACE_OR_REMOVE__MarkDown_Okay</releaseNotes> -->
<!-- =============================== -->

<!-- Specifying dependencies and version ranges? https://docs.nuget.org/create/versioning#specifying-version-ranges-in-.nuspec-files -->
<!--<dependencies>
<dependency id="" version="__MINIMUM_VERSION__" />
<dependency id="" version="[__EXACT_VERSION__]" />
<dependency id="" version="[_MIN_VERSION_INCLUSIVE, MAX_VERSION_INCLUSIVE]" />
<dependency id="" version="[_MIN_VERSION_INCLUSIVE, MAX_VERSION_EXCLUSIVE)" />
<dependency id="" />
<dependency id="chocolatey-core.extension" version="1.1.0" />
</dependencies>-->
<!-- chocolatey-core.extension - https://chocolatey.org/packages/chocolatey-core.extension
- You want to use Get-UninstallRegistryKey on less than 0.9.10 (in chocolateyUninstall.ps1)
- You want to use Get-PackageParameters and on less than 0.11.0
- You want to take advantage of other functions in the core community maintainer's team extension package
-->

<!--<provides>NOT YET IMPLEMENTED</provides>-->
<!--<conflicts>NOT YET IMPLEMENTED</conflicts>-->
<!--<replaces>NOT YET IMPLEMENTED</replaces>-->
</metadata>
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->
<file src="tools\**" target="tools" />
<!--Building from Linux? You may need this instead: <file src="tools/**" target="tools" />-->
</files>
</package>
Empty file added dist/choco/tools/.gitkeep
Empty file.

0 comments on commit 7ab2bf4

Please sign in to comment.