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

92 lines
2.7 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
2019-03-13 04:14:30 -07:00
paths-ignore:
- 'README.md'
2020-10-06 10:21:00 -07:00
- 'CONTRIBUTING.md'
- 'COPYING'
2019-03-13 04:14:30 -07:00
- 'docs/**'
2020-10-06 10:43:18 -07:00
- '.github/*.md'
- '.github/FUNDING.yml'
2019-03-13 04:14:30 -07:00
jobs:
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2020-09-11 23:42:26 -07:00
version: ${{ steps.changelog.outputs.version }}
2019-03-13 04:14:30 -07:00
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"
2020-09-21 02:42:02 -07:00
skip-on-empty: "false"
2019-03-13 04:14:30 -07:00
- 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 }}
2020-10-15 04:19:08 -07:00
asset_path: ${{ matrix.ARTIFACT }}
2019-03-13 04:14:30 -07:00
asset_name: ${{ matrix.ARTIFACT }}
asset_content_type: application/octet-stream
2020-09-11 23:42:26 -07:00
powershell:
needs: [release, artifacts]
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
2020-10-15 04:19:08 -07:00
working-directory: ${{ github.workspace }}/packages/powershell/oh-my-posh
2020-09-11 23:42:26 -07:00
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