2020-08-28 02:35:32 +00:00
|
|
|
name: ci
|
2020-08-28 02:31:51 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-09-24 21:42:36 +00:00
|
|
|
branches: [master]
|
2021-09-24 21:38:38 +00:00
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
- "**/.gitignore"
|
|
|
|
- ".github/workflows/**"
|
2020-08-28 02:31:51 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-09-24 21:38:38 +00:00
|
|
|
lint:
|
2021-07-31 19:53:00 +00:00
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-24 21:38:38 +00:00
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Run golangci lint
|
2021-07-31 19:53:00 +00:00
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
|
2020-08-28 02:31:51 +00:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-24 21:38:38 +00:00
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Go
|
2020-08-28 02:31:51 +00:00
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-04-06 01:18:45 +00:00
|
|
|
go-version: ^1.17
|
2020-08-28 02:31:51 +00:00
|
|
|
- name: Build
|
|
|
|
run: make build
|
2021-09-24 21:38:38 +00:00
|
|
|
|
|
|
|
tag:
|
|
|
|
name: Tag
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [lint, build]
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set GitHub Actions as commit author
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
git config user.name "github-actions[bot]"
|
|
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
|
|
|
|
- name: Setup sv4git
|
|
|
|
run: |
|
|
|
|
curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \
|
|
|
|
&& tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz
|
|
|
|
|
|
|
|
- name: Create tag
|
|
|
|
id: create-tag
|
|
|
|
run: |
|
|
|
|
git sv tag
|
|
|
|
VERSION=$(git sv cv)
|
|
|
|
echo "::set-output name=tag::v$VERSION"
|
|
|
|
outputs:
|
|
|
|
tag: ${{ steps.create-tag.outputs.tag }}
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [tag]
|
|
|
|
steps:
|
|
|
|
- name: Check out code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup sv4git
|
|
|
|
run: |
|
|
|
|
curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \
|
|
|
|
&& tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
id: go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-04-06 01:18:45 +00:00
|
|
|
go-version: ^1.17
|
2021-09-24 21:38:38 +00:00
|
|
|
|
|
|
|
- name: Create release notes
|
|
|
|
run: |
|
|
|
|
git sv rn -t "${{ needs.tag.outputs.tag }}" > release-notes.md
|
|
|
|
|
|
|
|
- name: Build releases
|
|
|
|
run: make release-all
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
body_path: release-notes.md
|
|
|
|
tag_name: ${{ needs.tag.outputs.tag }}
|
|
|
|
fail_on_unmatched_files: true
|
|
|
|
files: |
|
|
|
|
bin/git-sv_*
|