This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
generated from Gomorroth/vpm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.72 KB
/
initialize-package.yml
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
name: "Initialize Package"
on:
workflow_dispatch:
inputs:
name:
description: "Package Name"
required: true
default: "vpm-package"
permissions:
contents: write
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get old package name
id: packageName
uses: notiz-dev/github-action-json-property@release
with:
path: "package.json"
prop_path: "name"
- name: Rename package name
uses: microsoft/variable-substitution@v1
with:
files: package.json
env:
name: ${{ github.event.inputs.name }}
url : ${{ github.server_url }}/${{ github.repository }}
- name: Rename assembly definitions
run: |
sed -i -e "s/${{steps.packageName.outputs.prop}}/${{ github.event.inputs.name }}/" ./Editor/${{steps.packageName.outputs.prop}}.editor.asmdef
git mv ./Editor/${{steps.packageName.outputs.prop}}.editor.asmdef ./Editor/${{ github.event.inputs.name }}.editor.asmdef
sed -i -e "s/${{steps.packageName.outputs.prop}}/${{ github.event.inputs.name }}/" ./Runtime/${{steps.packageName.outputs.prop}}.runtime.asmdef
git mv ./Runtime/${{steps.packageName.outputs.prop}}.runtime.asmdef ./Runtime/${{ github.event.inputs.name }}.runtime.asmdef
- name: Commit changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add * -A
git commit -m "Initialize package"
git push origin main