-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (82 loc) · 4.12 KB
/
release.yml
File metadata and controls
95 lines (82 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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_activities/mod_ccpbiosim_activities.xml
xmlstarlet ed --inplace -u "/extension/version" -v ${{ github.event.inputs.version }} pkg_ccpbiosim/constituents/mod_ccpbiosim_events/mod_ccpbiosim_events.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_youtube/mod_ccpbiosim_youtube.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.1
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_activities/mod_ccpbiosim_activities.xml
- Update mod_ccpbiosim_events/mod_ccpbiosim_events.xml
- Update mod_ccpbiosim_hero/mod_ccpbiosim_hero.xml
- Update mod_ccpbiosim_mailinglist/mod_ccpbiosim_mailinglist.xml
- Update mod_ccpbiosim_youtube/mod_ccpbiosim_youtube.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@v3.0.0
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