Skip to content

Commit

Permalink
ci: Set up dev and tag luarocks release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijanhusak committed Aug 22, 2024
1 parent 4616941 commit b14b5d5
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 57 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
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:
runs-on: ubuntu-latest
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:
Expand All @@ -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
39 changes: 0 additions & 39 deletions .github/workflows/luarocks_dev.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
16 changes: 16 additions & 0 deletions .github/workflows/release_dev.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 1 addition & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: tests

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_call:

env:
CI: true
Expand Down

0 comments on commit b14b5d5

Please sign in to comment.