Skip to content

Commit

Permalink
Reworked manifest auto-updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiger-Tom committed Nov 28, 2023
1 parent f4ef1c8 commit a846d2e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 27 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/autoupdate-rsplugins_builtin-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto-update _rsplugins/1000-builtin/MANIFEST.ini
on:
push:
branches:
- 'v3.x.x'
paths:
- '_rsplugins/1000-builtin/**'
- '_rsplugins/1000-builtin/**/*'
workflow_dispatch:
jobs:
update_manif:
uses: ./.github/workflows/update-manifest.yml
with:
path: './_rsplugins/1000-builtin'
secrets:
key: ${{ secrets.MAN_KEY }}
16 changes: 16 additions & 0 deletions .github/workflows/autoupdate-rsruntime-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto-update _rsruntime/MANIFEST.ini
on:
push:
branches:
- 'v3.x.x'
paths:
- '_rsruntime/**'
- '_rsruntime/**/*'
workflow_dispatch:
jobs:
update_manif:
uses: ./.github/workflows/update-manifest.yml
with:
path: './_rsruntime'
secrets:
key: ${{ secrets.MAN_KEY }}
47 changes: 20 additions & 27 deletions .github/workflows/update-manifest.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
name: Update Manifests
name: Update a manifest
on:
push:
branches:
- 'v3.x.x'
paths:
- '_rsruntime/**'
- '_rsruntime/**/*'
- '_rsplugins/1000-builtin/**'
- '_rsplugins/1000-builtin/**/*'
workflow_dispatch:
workflow_call:
inputs:
path:
required: true
secrets:
key:
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
update_manif:
strategy:
max-parallel: 1
matrix:
manif: ['_rsruntime', '_rsplugins/1000-builtin']
name: "Update manifest for ${{ matrix.manif }}"
update_manifest:
name: "Update manifest ${{ inputs.path }}"
runs-on: ubuntu-latest
env:
MAN_KEY: ${{ secrets.key }}
MAN_PATH: ${{ inputs.path }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: pip
- name: "Print python3 version"
run: "python3 --version"
- name: "Explicitly install requirements"
run: "python3 -m pip install -r requirements.txt"
- name: "Extract key"
env:
MAN_KEY: ${{ secrets.MAN_KEY }}
run: |
echo "$MAN_KEY" | python3 ./devel/pysign.py readinto ./key.pyk
echo "$MAN_KEY" | python3 ./devel/pysign.py readinto ./key.pykk
- name: "Update manifest"
env:
MAN_PATH: ${{ matrix.manif }}
run: |
python3 ./devel/mkmanifest.py update "$MAN_PATH/MANIFEST.ini" "$MAN_PATH/" --overwrite
- name: "Sign manifest"
env:
MAN_PATH: ${{ matrix.manif }}
run: |
python3 ./devel/mkmanifest.py sign "$MAN_PATH/MANIFEST.ini" ./key.pyk --overwrite
python3 ./devel/mkmanifest.py sign "$MAN_PATH/MANIFEST.ini" ./key.pyk
- name: "Remove key"
run: "rm ./key.pyk"
- name: "Commit and push changes"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Automatic manifest update for ${{ matrix.manif }} (triggered by ${{ github.actor }}: ${{ github.sha }})"
commit_message: "Automatic manifest update for ${{ matrix.manif }} (triggered by ${{ github.actor }}: ${{ github.sha }})"

0 comments on commit a846d2e

Please sign in to comment.