Skip to content

Relatives... I am not good at this #7

Relatives... I am not good at this

Relatives... I am not good at this #7

Workflow file for this run

name: Sign and Release Module
on:
push:
branches:
- 'release/*'
jobs:
sign_and_release_module:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path : ${{ github.event.repository.name }}
- name: Install GPG
run: sudo apt-get update && sudo apt-get install gnupg -y
- name: Import GPG key
run: echo "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode | gpg --import
- name: Extract version and rawname from module.xml
id: extract_info
run: |
version=$(awk -F'[><]' '/<version>/{print $3}' ./${{ github.event.repository.name }}/module.xml)
rawname=$(awk -F'[><]' '/<rawname>/{print $3}' ./${{ github.event.repository.name }}/module.xml)
echo "::set-output name=version::$version"
echo "::set-output name=rawname::$rawname"
# Assuming your module build/packaging places the file and signing script in the working directory
- name: Sign module
run: ./${{ github.event.repository.name }}/.github/workflows/sign.sh ${{ steps.extract_info.outputs.rawname }} "${{ secrets.GPG_SIGNING_KEY }}" ./${{ github.event.repository.name }}/.github/workflows/exclude.txt
- name: Push signed module to releases
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.extract_info.outputs.rawname }}-${{ steps.extract_info.outputs.version }}.tar.gz
tag_name: v${{ steps.extract_info.outputs.version }}
title: Release ${{ steps.extract_info.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}