diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json new file mode 100644 index 0000000..0b922d0 --- /dev/null +++ b/.github/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.2.0" +} diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 0000000..49e6201 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "simple", + "extra-files": [ + "lua/rest-nvim/api.lua" + ] + } + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..37bc73d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + sync-readme: + name: sync readme codes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: run substitution + run: | + vimcmd="/default-config:start/+1,/default-config:end/-1y a |\ + e README.md |\ + /default-config:start/+2,/default-config:end/-2d |\ + /default-config:start/+1put a |\ + wq"; vim lua/rest-nvim/config/default.lua -c "$vimcmd" + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "docs: update README default config section" + branch: ${{ github.ref }} + + release: + name: release + runs-on: ubuntu-latest + needs: [sync-readme] + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.CI_TOKEN }} + config-file: .github/release-please-config.json + manifest-file: .github/.release-please-manifest.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3576456..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release Please Automatic Semver - -on: - push: - branches: - - main - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -jobs: - release: - name: release - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@v4 - id: release - with: - token: ${{ secrets.CI_TOKEN }} - release-type: simple - # - uses: actions/checkout@v4 - # if: ${{ steps.release.outputs.prs_created }} - # - name: Update Version String - # if: ${{ steps.release.outputs.prs_created }} - # run: | - # new_tag=${{ steps.release.outputs.tag_name }} - # - # echo "Updating \`rest.nvim\` Version to $new_tag" - # # sed -ri "s/api\.VERSION\s*=\s*\"[0-9\.\-]+\"$/api.VERSION = \"${new_tag:1}\"/" lua/rest-nvim/api.lua - # - name: Commit changes - # if: ${{ steps.release.outputs.prs_created }} - # uses: stefanzweifel/git-auto-commit-action@v5 - # with: - # commit_message: "chore(api.lua): update version variable" - # branch: ${{ github.ref }} - # - name: Push to Github - # if: ${{ steps.release.outputs.prs_created }} - # uses: ad-m/github-push-action@master - # with: - # github_token: ${{ secrets.GITHUB_TOKEN }} - # branch: ${{ github.ref }} diff --git a/lua/rest-nvim/api.lua b/lua/rest-nvim/api.lua index 32d822f..d288920 100644 --- a/lua/rest-nvim/api.lua +++ b/lua/rest-nvim/api.lua @@ -18,7 +18,7 @@ local client = function() return require("rest-nvim.client") end ---rest.nvim API version, equals to the current rest.nvim version. Meant to be used by modules later ---@type string ---@see vim.version -api.VERSION = "3.1.0" +api.VERSION = "3.1.0" -- x-release-please-version ---rest.nvim namespace used for buffer highlights ---@type number diff --git a/lua/rest-nvim/config/default.lua b/lua/rest-nvim/config/default.lua index 0860082..a6c0bc2 100644 --- a/lua/rest-nvim/config/default.lua +++ b/lua/rest-nvim/config/default.lua @@ -1,5 +1,6 @@ ---@mod rest-nvim.config.default rest.nvim default configuration +---@comment default-config:start ---rest.nvim default configuration ---@class rest.Config local default_config = { @@ -86,5 +87,6 @@ local default_config = { unrecognized_configs = nil, }, } +---@comment default-config:end return default_config