mirror of
https://github.com/chenasraf/text-transform.nvim.git
synced 2026-05-17 17:48:04 +00:00
107 lines
2.5 KiB
YAML
107 lines
2.5 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
types: [opened, synchronize]
|
|
|
|
# concurrency:
|
|
# group: github.head_ref
|
|
# cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: lint
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: JohnnyMorganz/stylua-action@v2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: latest
|
|
args: --check .
|
|
|
|
documentation:
|
|
runs-on: ubuntu-latest
|
|
name: documentation
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: setup neovim
|
|
uses: rhysd/action-setup-vim@v1
|
|
with:
|
|
neovim: true
|
|
version: v0.8.3
|
|
|
|
- name: generate documentation
|
|
run: make documentation-ci
|
|
|
|
- name: check docs diff
|
|
run: |
|
|
git status doc
|
|
ex=$(git status --porcelain doc | wc -l | tr -d " ")
|
|
if [[ $ex -ne 0 ]]; then git diff doc; fi
|
|
exit $ex
|
|
|
|
tests:
|
|
needs:
|
|
- lint
|
|
- documentation
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
strategy:
|
|
matrix:
|
|
neovim_version: ['v0.7.2', 'v0.8.3', 'v0.9.0', 'nightly']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: date +%F > todays-date
|
|
|
|
- name: restore cache for today's nightly.
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: _neovim
|
|
key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }}
|
|
|
|
- name: setup neovim
|
|
uses: rhysd/action-setup-vim@v1
|
|
with:
|
|
neovim: true
|
|
version: ${{ matrix.neovim_version }}
|
|
|
|
- name: run tests
|
|
run: make test-ci
|
|
|
|
release:
|
|
name: release
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
permissions: write-all
|
|
needs:
|
|
- tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: google-github-actions/release-please-action@v3
|
|
id: release
|
|
with:
|
|
release-type: simple
|
|
package-name: text-transform.nvim
|
|
|
|
- name: tag stable versions
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
run: |
|
|
git config user.name github-actions[bot]
|
|
git config user.email github-actions[bot]@users.noreply.github.com
|
|
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
|
|
git tag -d stable || true
|
|
git push origin :stable || true
|
|
git tag -a stable -m "Last Stable Release"
|
|
git push origin stable
|