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'
|
|
|
|
- 'docs/**'
|
|
|
|
|
|
|
|
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
|
|
|
|
env:
|
|
|
|
GOPATH: ${{ github.workspace }}
|
|
|
|
GO111MODULE: off
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
ARTIFACT: posh-linux-amd64
|
|
|
|
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
|
|
- os: macos-latest
|
|
|
|
ARTIFACT: posh-darwin-amd64
|
|
|
|
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
|
|
- os: windows-latest
|
|
|
|
ARTIFACT: posh-windows-amd64.exe
|
|
|
|
INSTALL_DEP: choco install dep
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
|
|
|
|
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
|
|
|
|
with:
|
|
|
|
path: ./src/github.com/${{ github.repository }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
${{ matrix.INSTALL_DEP }}
|
|
|
|
dep ensure -v
|
|
|
|
- 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: ./src/github.com/${{ github.repository }}/${{ matrix.ARTIFACT }}
|
|
|
|
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-03 11:36:49 -07:00
|
|
|
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}/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
|
|
|
|
with:
|
|
|
|
path: ./src/github.com/${{ github.repository }}
|
|
|
|
- name: Pack and push
|
|
|
|
run: ./deploy.ps1 -BinVersion ${{ needs.release.outputs.version }} -ModuleVersion ${{ needs.release.outputs.version }} -Repository PSGallery -RepositoryAPIKey $env:PSGALLERY_KEY
|