Skip to content

ci: automatically update manifest.json on releases #31

ci: automatically update manifest.json on releases

ci: automatically update manifest.json on releases #31

Workflow file for this run

name: CI
on:
push:
workflow_dispatch:
inputs:
version:
description: Release version
type: string
required: false
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Update packages
run: sudo apt update
- name: Install lua
run: sudo apt install -y lua5.4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install meson ninja
- name: Setup meson
run: meson setup --buildtype=release build
- name: Build
run: meson compile -C build
- name: Run Tests
run: meson test -C build
- name: Create test summary
uses: test-summary/action@v2
with:
paths: build/meson-logs/testlog.junit.xml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: myers_midpoint
path: build/myers_midpoint.so
Publish:
needs: Build
if: ${{ inputs.version != '' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Update packages
run: sudo apt update
- name: Install dependencies
run: sudo apt install -y jq moreutils
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Obtain native module checksum
run: |
echo CHECKSUM="$(sha256sum myers_midpoint/myers_midpoint.so | awk '{ print $1 }')" >> "$GITHUB_ENV"
- name: Update manifest
run: |
jq ".addons[0].version = \"${{ inputs.version }}\" |\
.addons[0].files[0].checksum = \"${CHECKSUM}\" |\
.addons[0].files[0].url = \"${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.version }}/myers_midpoint.so\"" manifest.json | sponge manifest.json
- name: Configure git
run: |
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Push updated manifest
run: |
git add manifest.json && git commit -m 'chore: update manifest'
- name: Create a tag
run: git tag -a -m "Version ${{ inputs.version }}" "${{ inputs.version }}"
- name: Push changes
run: git push
- name: Release
uses: softprops/action-gh-release@v2
with:
name: coro_diff ${{ inputs.version }}
tag_name: ${{ inputs.version }}
files: myers_midpoint/myers_midpoint.so