2019-03-13 04:14:30 -07:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-10-05 10:44:46 -07:00
|
|
|
- main
|
2021-04-03 03:57:32 -07:00
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'packages/**'
|
2021-12-01 22:54:49 -08:00
|
|
|
- '.github/workflows/**'
|
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 👋
|
2024-05-16 17:06:41 -07:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Create changelog ✍️
|
2019-03-13 04:14:30 -07:00
|
|
|
id: changelog
|
2024-05-21 17:19:18 -07:00
|
|
|
uses: TriPSs/conventional-changelog-action@3a392e9aa44a72686b0fc13259a90d287dd0877c
|
2019-03-13 04:14:30 -07:00
|
|
|
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
|
2021-12-02 13:42:38 -08:00
|
|
|
env:
|
|
|
|
COSIGN_KEY_LOCATION: "/tmp/cosign.key"
|
2020-09-11 23:42:26 -07:00
|
|
|
defaults:
|
|
|
|
run:
|
2021-12-02 13:42:38 -08:00
|
|
|
shell: pwsh
|
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: Checkout code 👋
|
2024-05-16 17:06:41 -07:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
2021-12-19 02:28:46 -08:00
|
|
|
- name: Install Go 🗳
|
|
|
|
uses: ./.github/workflows/composite/bootstrap-go
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Tag HEAD 😸
|
2023-03-21 06:10:53 -07:00
|
|
|
run: |
|
|
|
|
git config --global user.name "GitHub Actions"
|
|
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git tag ${{ needs.changelog.outputs.tag }}
|
2021-12-02 13:42:38 -08:00
|
|
|
- name: Install cosign 🔑
|
2024-04-10 18:02:48 -07:00
|
|
|
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20
|
2021-12-02 13:42:38 -08:00
|
|
|
with:
|
2021-12-08 04:52:14 -08:00
|
|
|
cosign-release: 'v1.4.0'
|
2021-12-02 13:42:38 -08:00
|
|
|
- name: Private Key 🔐
|
|
|
|
run: |
|
|
|
|
$PSDefaultParameterValues['Out-File:Encoding']='UTF8'
|
|
|
|
$env:COSIGN_KEY > $env:COSIGN_KEY_LOCATION
|
|
|
|
env:
|
|
|
|
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Run GoReleaser 🚀
|
2024-05-12 17:57:50 -07:00
|
|
|
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811
|
2021-10-06 12:43:18 -07:00
|
|
|
with:
|
|
|
|
distribution: goreleaser
|
|
|
|
version: latest
|
2023-12-16 12:01:04 -08:00
|
|
|
args: build --clean
|
2021-10-06 12:43:18 -07:00
|
|
|
workdir: src
|
2021-12-02 13:42:38 -08:00
|
|
|
env:
|
|
|
|
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Zip theme files 🤐
|
|
|
|
run: |
|
|
|
|
$compress = @{
|
2022-06-06 06:46:10 -07:00
|
|
|
Path = "../themes/*.omp.*"
|
2021-10-06 12:43:18 -07:00
|
|
|
CompressionLevel = "Fastest"
|
|
|
|
DestinationPath = "./dist/themes.zip"
|
|
|
|
}
|
|
|
|
Compress-Archive @compress
|
|
|
|
- name: Add hashes 🤫
|
|
|
|
run: |
|
2021-12-03 04:51:35 -08:00
|
|
|
Get-ChildItem ./dist -Exclude *.yaml,*.sig | Get-Unique |
|
2021-10-06 12:43:18 -07:00
|
|
|
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 🎓
|
2024-05-07 17:53:02 -07:00
|
|
|
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
|
2021-10-06 12:43:18 -07:00
|
|
|
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.*
|