oh-my-posh/.github/workflows/release.yml

82 lines
2.3 KiB
YAML
Raw Normal View History

2019-03-13 04:14:30 -07:00
name: Release
on:
push:
branches:
2020-10-05 10:44:46 -07:00
- main
paths:
- 'src/**'
- 'packages/**'
2021-10-06 12:43:18 -07:00
- '.github/*'
2019-03-13 04:14:30 -07:00
jobs:
2021-10-06 12:43:18 -07:00
changelog:
2019-03-13 04:14:30 -07:00
runs-on: ubuntu-latest
outputs:
2020-09-11 23:42:26 -07:00
version: ${{ steps.changelog.outputs.version }}
2021-10-06 12:43:18 -07:00
body: ${{ steps.changelog.outputs.clean_changelog }}
tag: ${{ steps.changelog.outputs.tag }}
2020-10-25 05:20:17 -07:00
skipped: ${{ steps.changelog.outputs.skipped }}
2019-03-13 04:14:30 -07:00
steps:
2021-10-06 12:43:18 -07:00
- name: Checkout code 👋
2019-03-13 04:14:30 -07:00
uses: actions/checkout@v2
2021-10-06 12:43:18 -07:00
- name: Create changelog ✍️
2019-03-13 04:14:30 -07:00
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
skip-version-file: "true"
output-file: "false"
skip-commit: "true"
2020-10-25 05:20:17 -07:00
skip-on-empty: "true"
2019-03-13 04:14:30 -07:00
artifacts:
2021-10-06 12:43:18 -07:00
needs: changelog
if: ${{ needs.changelog.outputs.skipped == 'false' }}
2020-09-11 23:42:26 -07:00
runs-on: ubuntu-latest
defaults:
run:
2021-10-06 12:43:18 -07:00
working-directory: ${{ github.workspace }}/src
2020-10-27 04:10:22 -07:00
steps:
2021-10-06 12:43:18 -07:00
- 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
2021-01-28 12:53:45 -08:00
shell: pwsh
2021-10-06 12:43:18 -07:00
- 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"
}
2021-01-29 10:50:11 -08:00
shell: pwsh
2021-10-06 12:43:18 -07:00
- name: Release 🎓
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.changelog.outputs.tag }}
2021-11-28 10:48:56 -08:00
body: ${{ needs.changelog.outputs.body }}
2021-10-06 12:43:18 -07:00
fail_on_unmatched_files: true
token: ${{ secrets.GH_PAT }}
files: |
src/dist/posh-*
src/dist/themes.*