oh-my-posh/.github/workflows/release.yml
2021-12-02 07:54:49 +01:00

82 lines
2.4 KiB
YAML

name: Release
on:
push:
branches:
- main
paths:
- 'src/**'
- 'packages/**'
- '.github/workflows/**'
jobs:
changelog:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog.outputs.version }}
body: ${{ steps.changelog.outputs.clean_changelog }}
tag: ${{ steps.changelog.outputs.tag }}
skipped: ${{ steps.changelog.outputs.skipped }}
steps:
- name: Checkout code 👋
uses: actions/checkout@v2
- name: Create changelog ✍️
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
skip-version-file: "true"
output-file: "false"
skip-commit: "true"
skip-on-empty: "true"
artifacts:
needs: changelog
if: ${{ needs.changelog.outputs.skipped == 'false' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}/src
steps:
- name: Install Go 🗳
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Checkout code 👋
uses: actions/checkout@v2
- name: Tag HEAD 😸
run: git tag ${{ needs.changelog.outputs.tag }}
- name: Run GoReleaser 🚀
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: build --rm-dist
workdir: src
- name: Zip theme files 🤐
run: |
$compress = @{
Path = "../themes/*.omp.json"
CompressionLevel = "Fastest"
DestinationPath = "./dist/themes.zip"
}
Compress-Archive @compress
shell: pwsh
- name: Add hashes 🤫
run: |
Get-ChildItem ./dist -Exclude *.yaml | Get-Unique |
Foreach-Object {
$zipHash = Get-FileHash $_.FullName -Algorithm SHA256
$zipHash.Hash | Out-File -Encoding 'UTF8' "./dist/$($_.Name).sha256"
}
shell: pwsh
- name: Release 🎓
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.changelog.outputs.tag }}
body: ${{ needs.changelog.outputs.body }}
fail_on_unmatched_files: true
token: ${{ secrets.GH_PAT }}
files: |
src/dist/posh-*
src/dist/themes.*