Skip to content

ci: fix sed commands in release workflow #9

ci: fix sed commands in release workflow

ci: fix sed commands in release workflow #9

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
branches:
- main
- 'renovate/**'
paths:
- .github/workflows/release.yml
pull_request:
branches:
- main
paths:
- .github/workflows/release.yml
jobs:
#check:
# name: Check
# uses: ./.github/workflows/check.yml
luarocks-upload:
name: LuaRocks Upload
runs-on: ubuntu-latest
#needs: check
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Lua
uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e # v10.0.0
- name: Setup LuaRocks
uses: hishamhm/gh-actions-luarocks@master
- name: Modify rockspec & upload to LuaRocks server
run: |
set -x
version="${{ github.ref_name }}"
rockspec="fenster-${version#v}-1.rockspec"
git mv fenster-dev-1.rockspec "$rockspec"
sed -i -E "s/\bversion\s*=\s*('|\"|\[\[)\s*[a-zA-Z0-9.-]+\s*('|\"|\]\])/version = '${version#v}-1'/" "$rockspec"
sed -i -E "s/\bbranch\s*=\s*('|\"|\[\[)\s*[a-zA-Z0-9.-_\/]+\s*('|\"|\]\])/tag = '$version'/" "$rockspec"
git diff
if [[ -z "$(git status --porcelain)" ]]; then
echo "Rockspec not modified"
exit 1
fi
luarocks upload --temp-key "${{ secrets.LUAROCKS_API_KEY }}" "$rockspec"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
github-release:
name: GitHub Release
runs-on: ubuntu-latest
needs: luarocks-upload
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Release on GitHub
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
draft: true
generate_release_notes: true
#files: **/*.rock
#fail_on_unmatched_files: true