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:
|
2024-10-05 04:16:47 -07:00
|
|
|
runs-on: macos-latest
|
2019-03-13 04:14:30 -07:00
|
|
|
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-10-23 18:02:58 -07:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Create changelog ✍️
|
2019-03-13 04:14:30 -07:00
|
|
|
id: changelog
|
2024-10-24 17:44:42 -07:00
|
|
|
uses: TriPSs/conventional-changelog-action@3c4970b6573374889b897403d2f1278c395ea0df
|
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' }}
|
2024-07-09 00:52:49 -07:00
|
|
|
runs-on: windows-latest
|
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-10-23 18:02:58 -07:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
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 }}
|
2024-07-09 00:52:49 -07:00
|
|
|
- name: Prerequisites 🔐
|
2021-12-02 13:42:38 -08:00
|
|
|
run: |
|
|
|
|
$PSDefaultParameterValues['Out-File:Encoding']='UTF8'
|
2024-07-09 00:52:49 -07:00
|
|
|
|
|
|
|
$shaSigningKeyLocation = Join-Path -Path $env:RUNNER_TEMP -ChildPath sha_signing_key.pem
|
|
|
|
$env:SIGNING_KEY > $shaSigningKeyLocation
|
|
|
|
Write-Output "SHA_SIGNING_KEY_LOCATION=$shaSigningKeyLocation" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
|
|
|
# create a base64 encoded value of your certificate using
|
|
|
|
# [convert]::ToBase64String((Get-Content -path "certificate.pfx" -AsByteStream))
|
|
|
|
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "code_signing_cert.pfx"
|
|
|
|
$encodedBytes = [System.Convert]::FromBase64String($env:SIGNING_CERTIFICATE)
|
|
|
|
Set-Content -Path $pfxPath -Value $encodedBytes -AsByteStream
|
|
|
|
Write-Output "SIGNING_CERTIFICATE_LOCATION=$pfxPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
|
|
|
# requires Windows Dev Kit 10.0.22621.0
|
|
|
|
$signtool = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x86/signtool.exe'
|
|
|
|
Write-Output "SIGNTOOL=$signtool" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
|
|
|
|
# openssl
|
|
|
|
$openssl = 'C:/Program Files/Git/usr/bin/openssl.exe'
|
|
|
|
Write-Output "OPENSSL=$openssl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
2021-12-02 13:42:38 -08:00
|
|
|
env:
|
2024-07-09 00:52:49 -07:00
|
|
|
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
|
|
|
SIGNING_CERTIFICATE: ${{ secrets.CERTIFICATE }}
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Run GoReleaser 🚀
|
2024-11-07 16:40:57 -08:00
|
|
|
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf
|
2021-10-06 12:43:18 -07:00
|
|
|
with:
|
|
|
|
distribution: goreleaser
|
2024-11-04 05:22:07 -08:00
|
|
|
version: v2.3.2
|
2024-07-04 01:20:49 -07:00
|
|
|
args: release --clean --skip publish
|
2021-10-06 12:43:18 -07:00
|
|
|
workdir: src
|
2024-07-09 00:52:49 -07:00
|
|
|
env:
|
|
|
|
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_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"
|
|
|
|
}
|
|
|
|
- name: Release 🎓
|
2024-10-31 17:08:54 -07:00
|
|
|
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8
|
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.*
|
2024-07-04 02:33:01 -07:00
|
|
|
src/dist/checksums.*
|