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

151 lines
5.1 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/**"
- ".github/workflows/**"
2019-03-13 04:14:30 -07:00
jobs:
2021-10-06 12:43:18 -07:00
changelog:
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 👋
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
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"
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' }}
runs-on: windows-latest
2020-09-11 23:42:26 -07:00
defaults:
run:
2021-12-02 13:42:38 -08:00
shell: pwsh
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 👋
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install Go 🗳
uses: ./.github/workflows/composite/bootstrap-go
- name: Pre Build 😸
2021-12-02 13:42:38 -08:00
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
./pre.ps1 -Version ${{ needs.changelog.outputs.version }}
2021-10-06 12:43:18 -07:00
- name: Run GoReleaser 🚀
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
args: release --clean --skip publish
2021-10-06 12:43:18 -07:00
workdir: src
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 }}
- 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: |
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: |
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 🎓
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: |
*