oh-my-posh/.github/workflows/release.yml
2020-10-15 06:08:47 -07:00

92 lines
2.7 KiB
YAML

name: Release
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'COPYING'
- 'docs/**'
- '.github/*.md'
- '.github/FUNDING.yml'
jobs:
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.changelog.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
skip-version-file: "true"
output-file: "false"
skip-commit: "true"
skip-on-empty: "false"
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
artifacts:
needs: release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
ARTIFACT: posh-linux-amd64
- os: macos-latest
ARTIFACT: posh-darwin-amd64
- os: windows-latest
ARTIFACT: posh-windows-amd64.exe
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Checkout code
uses: actions/checkout@v2
- name: Build
id: build
run: go build -o ${{ matrix.ARTIFACT }}
env:
GOARCH: "amd64"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ matrix.ARTIFACT }}
asset_name: ${{ matrix.ARTIFACT }}
asset_content_type: application/octet-stream
powershell:
needs: [release, artifacts]
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: ${{ github.workspace }}/packages/powershell/oh-my-posh
env:
PSGALLERY_KEY: ${{ secrets.PSGALLERY_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Pack and push
run: ./deploy.ps1 -BinVersion ${{ needs.release.outputs.version }} -ModuleVersion ${{ needs.release.outputs.version }} -Repository PSGallery -RepositoryAPIKey $env:PSGALLERY_KEY