Skip to content

release

release #67

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
version:
required: true
default: 'x.y.z'
permissions:
contents: write
pull-requests: write
jobs:
version:
runs-on: ubuntu-24.04
name: prepare ${{ github.event.inputs.version }}
steps:
- name: Install xmlstartlet
run: sudo apt install xmlstarlet
- name: checkout
uses: actions/checkout@v6.0.2
- name: Inject version number into source file manifests
run: |
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/pkg_ccpbiosim.xml
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/constituents/com_ccpbiosim/ccpbiosim.xml
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/constituents/mod_ccpbiosim_hero/mod_ccpbiosim_hero.xml
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/constituents/mod_ccpbiosim_mailinglist/mod_ccpbiosim_mailinglist.xml
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/constituents/mod_ccpbiosim_activities/mod_ccpbiosim_activities.xml
- name: Inject version number into update.xml
run: xmlstarlet ed --omit-decl --inplace -u "/updates/update/version" -v ${{ github.event.inputs.version }} update.xml
- name: Inject update file path into update.xml
run: xmlstarlet ed --omit-decl --inplace -u "/updates/update/downloads/downloadurl" -v "https://github.com/ccpbiosim/pkg_ccpbiosim/releases/download/${{ github.event.inputs.version }}/pkg_ccpbiosim-${{ github.event.inputs.version }}.zip" update.xml
- name: Send version update PR
id: pr_id
uses: peter-evans/create-pull-request@v8.1.0
with:
commit-message: Update version to ${{ github.event.inputs.version }}
branch: version-update
title: "Update to version ${{ github.event.inputs.version }}"
body: |
Update version
- Update pkg_ccpbiosim/pkg_ccpbiosim.xml
- Update com_ccpbiosim/ccpbiosim.xml
- Update mod_ccpbiosim_hero/mod_ccpbiosim_hero.xml
- Update mod_ccpbiosim_mailinglist/mod_ccpbiosim_mailinglist.xml
- Update mod_ccpbiosim_activities/mod_ccpbiosim_activities.xml
- Update the update.xml with new release
- Auto-generated by [create-pull-request]
base: main
signoff: false
draft: false
- name: Auto merge PR
run: gh pr merge --merge --delete-branch --auto "${{ steps.pr_id.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create GH release.
needs: version
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
ref: main
- name: Tag v${{ github.event.inputs.version }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag ${{ github.event.inputs.version }}
git push origin tag ${{ github.event.inputs.version }}
- name: Create zip
run: |
zip -r pkg_ccpbiosim-${{ github.event.inputs.version }}.zip pkg_ccpbiosim
- name: Create release
uses: softprops/action-gh-release@v2.6.1
with:
name: v${{ github.event.inputs.version }}
generate_release_notes: true
tag_name: ${{ github.event.inputs.version }}
files: pkg_ccpbiosim-${{ github.event.inputs.version }}.zip