Create README.adoc #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*' ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: choco pack | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nupkg | |
path: '*.nupkg' | |
test: | |
runs-on: windows-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nupkg | |
- run: choco install --no-progress --ignore-dependencies xml2rfc -dv -s "'.;https://chocolatey.org/api/v2/'" | |
- name: test version | |
run: | | |
& xml2rfc --version | |
- run: choco uninstall xml2rfc -y | |
publish: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: windows-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: nupkg | |
- name: push to chocolatey | |
env: | |
CHOCO_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} | |
run: | | |
$namespaces = @{nuspec = "http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"} | |
$pkgVersion = Select-Xml -Path xml2rfc.nuspec ` | |
-XPath "/nuspec:package/nuspec:metadata/nuspec:version/text()" ` | |
-Namespace $namespaces | Select-Object -Expand Node | Select-Object -Expand Data | |
choco apikey -key $Env:CHOCO_API_KEY -source https://chocolatey.org/ | |
choco push xml2rfc.${pkgVersion}.nupkg -source https://chocolatey.org/ |