From b14b5d5883f01b363e51dfb859406027550bdf63 Mon Sep 17 00:00:00 2001 From: Kristijan Husak Date: Thu, 22 Aug 2024 10:56:37 +0200 Subject: [PATCH] ci: Set up dev and tag luarocks release workflow --- .github/workflows/luarocks.yml | 19 ++++++--------- .github/workflows/luarocks_dev.yml | 39 ------------------------------ .github/workflows/release.yml | 31 ++++++++++++++++++++++++ .github/workflows/release_dev.yml | 16 ++++++++++++ .github/workflows/tests.yml | 7 +----- 5 files changed, 55 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/luarocks_dev.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release_dev.yml diff --git a/.github/workflows/luarocks.yml b/.github/workflows/luarocks.yml index 1dcda01b4..2666d7120 100644 --- a/.github/workflows/luarocks.yml +++ b/.github/workflows/luarocks.yml @@ -1,14 +1,11 @@ name: Push to Luarocks on: - push: - tags: - - '*' - release: - types: - - created - pull_request: # Runs test install without uploading - workflow_dispatch: # Allows to trigger manually + workflow_call: + inputs: + luarocks_version: + type: string + required: true jobs: luarocks-upload: @@ -16,9 +13,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Required to count the commits - - name: Get Version - run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV + fetch-depth: 0 - name: Install C/C++ Compiler uses: rlalik/setup-cpp-compiler@master with: @@ -41,6 +36,6 @@ jobs: env: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} with: - version: ${{ env.LUAROCKS_VERSION }} + version: ${{ inputs.luarocks_version }} dependencies: | tree-sitter-orgmode ~> 1 diff --git a/.github/workflows/luarocks_dev.yml b/.github/workflows/luarocks_dev.yml deleted file mode 100644 index a2a3b0b27..000000000 --- a/.github/workflows/luarocks_dev.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Push dev to Luarocks - -on: - push: - branches: - - master - -jobs: - luarocks-upload: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Required to count the commits - - name: Install C/C++ Compiler - uses: rlalik/setup-cpp-compiler@master - with: - compiler: clang-latest - - name: Install tree-sitter CLI - uses: baptiste0928/cargo-install@v3 - with: - crate: tree-sitter-cli - - name: Install Lua - uses: leso-kn/gh-actions-lua@master - with: - luaVersion: "5.1" - - name: Install Luarocks - uses: hishamhm/gh-actions-luarocks@master - - name: Install `luarocks-build-treesitter-parser` Package - run: | - luarocks --verbose --local --lua-version=5.1 install luarocks-build-treesitter-parser - - name: LuaRocks Upload - uses: nvim-neorocks/luarocks-tag-release@v7 - env: - LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} - with: - version: "dev" - dependencies: | - tree-sitter-orgmode ~> 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..09247d8da --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Push release to Luarocks + +on: + push: + tags: + - '*' + release: + types: + - created + workflow_dispatch: + +jobs: + tests: + uses: ./.github/workflows/tests.yml + get_version: + needs: tests + runs-on: ubuntu-latest + outputs: + luarocks_version: ${{ steps.get_version_value.outputs.LUAROCKS_VERSION }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required to count the commits + - name: Get Version + id: get_version_value + run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT + luarocks-upload: + needs: get_version + uses: ./.github/workflows/luarocks.yml + with: + luarocks_version: ${{ needs.get_version.outputs.luarocks_version }} diff --git a/.github/workflows/release_dev.yml b/.github/workflows/release_dev.yml new file mode 100644 index 000000000..374619b62 --- /dev/null +++ b/.github/workflows/release_dev.yml @@ -0,0 +1,16 @@ +name: Push dev to Luarocks + +on: + push: + branches: + - master + pull_request: + +jobs: + tests: + uses: ./.github/workflows/tests.yml + luarocks-upload-dev: + needs: tests + uses: ./.github/workflows/luarocks.yml + with: + luarocks_version: dev diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3b457f083..8350bb59b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,7 @@ name: tests on: - push: - branches: - - master - pull_request: - branches: - - master + workflow_call: env: CI: true