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:
|
2024-11-27 02:29:42 -08:00
|
|
|
- "src/**"
|
|
|
|
- "packages/**"
|
|
|
|
- ".github/workflows/**"
|
2019-03-13 04:14:30 -07:00
|
|
|
|
|
|
|
jobs:
|
2021-10-06 12:43:18 -07:00
|
|
|
changelog:
|
2024-11-27 02:29:42 -08:00
|
|
|
runs-on: ubuntu-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-11-28 16:49:01 -08:00
|
|
|
uses: TriPSs/conventional-changelog-action@67139193614f5b9e8db87da1bd4240922b34d765
|
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"
|
2024-11-27 02:29:42 -08:00
|
|
|
skip-tag: "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
|
2024-11-27 02:29:42 -08:00
|
|
|
working-directory: ${{ github.workspace }}/build
|
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
|
2024-11-27 02:29:42 -08:00
|
|
|
- name: Pre Build 😸
|
2021-12-02 13:42:38 -08:00
|
|
|
env:
|
2024-07-09 00:52:49 -07:00
|
|
|
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
|
2024-11-27 02:29:42 -08:00
|
|
|
run: |
|
|
|
|
./pre.ps1 -Version ${{ needs.changelog.outputs.version }}
|
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:
|
2024-11-15 04:45:02 -08:00
|
|
|
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
|
|
|
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
|
|
|
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
2024-11-27 02:29:42 -08:00
|
|
|
- name: Post Build 🤐
|
|
|
|
run: |
|
|
|
|
./post.ps1
|
|
|
|
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
|
|
with:
|
|
|
|
name: build-artifacts
|
|
|
|
path: |
|
|
|
|
src/dist/posh-*
|
|
|
|
src/dist/themes.*
|
|
|
|
src/dist/checksums.*
|
|
|
|
msi:
|
|
|
|
needs:
|
|
|
|
- changelog
|
|
|
|
- artifacts
|
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [x64, arm64, x86]
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: pwsh
|
|
|
|
working-directory: ${{ github.workspace }}/packages/msi
|
|
|
|
steps:
|
|
|
|
- name: Checkout code 👋
|
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
|
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
|
|
|
with:
|
|
|
|
name: build-artifacts
|
|
|
|
path: dist
|
|
|
|
- name: Install Wix Toolset 🛠
|
|
|
|
run: dotnet tool install --global wix
|
|
|
|
- name: Build installer 📦
|
|
|
|
id: build
|
|
|
|
env:
|
|
|
|
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
|
|
|
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
|
|
|
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
|
|
|
run: |
|
|
|
|
$version = '${{ needs.changelog.outputs.version }}'.TrimStart("v")
|
|
|
|
./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Copy -Sign
|
|
|
|
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
|
|
with:
|
|
|
|
name: msi-artifact-${{ matrix.arch }}
|
|
|
|
path: |
|
|
|
|
packages/msi/out/install-${{ matrix.arch }}.msi
|
|
|
|
packages/msi/out/install-${{ matrix.arch }}.msi.sha256
|
|
|
|
cdn:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- changelog
|
|
|
|
- msi
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [x64, arm64, x86]
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
|
|
|
with:
|
|
|
|
name: msi-artifact-${{ matrix.arch }}
|
|
|
|
- name: Upload MSI to CDN
|
|
|
|
env:
|
|
|
|
CDN_CONNECTIONSTRING: ${{ secrets.CDN_CONNECTIONSTRING }}
|
2021-10-06 12:43:18 -07:00
|
|
|
run: |
|
2024-11-27 02:29:42 -08:00
|
|
|
az storage blob upload --container-name v${{ needs.changelog.outputs.version }} --file install-${{ matrix.arch }}.msi --connection-string $CDN_CONNECTIONSTRING
|
|
|
|
az storage blob upload --container-name latest --file install-${{ matrix.arch }}.msi --overwrite true --connection-string $CDN_CONNECTIONSTRING
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- changelog
|
|
|
|
- cdn
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
|
|
|
with:
|
|
|
|
merge-multiple: true
|
|
|
|
- name: Upload version file
|
|
|
|
env:
|
|
|
|
CDN_CONNECTIONSTRING: ${{ secrets.CDN_CONNECTIONSTRING }}
|
2021-10-06 12:43:18 -07:00
|
|
|
run: |
|
2024-11-27 02:29:42 -08:00
|
|
|
echo v${{ needs.changelog.outputs.version }} > version.txt
|
|
|
|
az storage blob upload --container-name latest --file version.txt --overwrite true --connection-string $CDN_CONNECTIONSTRING
|
2021-10-06 12:43:18 -07:00
|
|
|
- name: Release 🎓
|
2024-11-11 16:41:11 -08:00
|
|
|
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
|
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: |
|
2024-11-27 02:29:42 -08:00
|
|
|
*
|