Merge branch 'main' of https://github.com/Iam1337/extApi #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ⚙ Build and Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: ⚙ Release | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_NAME: extApi | |
PROJECT_ASSETS: README.md:CHANGELOG.md:LICENSE | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
branch: main | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
- name: Push UPM update | |
run: | | |
IFS=: read -r -a PROJECT_ASSETS_ARRAY <<< "$PROJECT_ASSETS" | |
mkdir Temp | |
for asset in "${PROJECT_ASSETS_ARRAY[@]}"; do | |
cp ${asset} Temp/${asset} | |
done | |
git log -1 | |
git subtree split -P "Assets/$PROJECT_NAME" -b upm | |
git checkout upm | |
for asset in "${PROJECT_ASSETS_ARRAY[@]}"; do | |
cp Temp/${asset} ${asset} | |
git add ${asset} | |
done | |
if [[ -d "Examples" ]]; then | |
git mv Examples Examples~ | |
rm -f Examples.meta | |
fi | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git commit -am "chore(release): update upm branch [skip ci]" | |
git push -f -u origin upm | |
- name: Push UPM tag | |
if: steps.semantic.outputs.new_release_published == 'true' | |
env: | |
UPM_TAG: upm/v${{ steps.semantic.outputs.new_release_version }} | |
run: | | |
git tag $UPM_TAG upm | |
git push origin --tags |