1.3.0 #3
Workflow file for this run
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: Release Package | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
package: | |
name: Deploy release package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get previous tag | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
- name: Create release package branch | |
run: | | |
git branch -d package &> /dev/null || echo package branch not found | |
git subtree split -P "$PKG_ROOT" -b package | |
if [[ -d "Assets/Samples" ]]; then | |
mv "Assets/Samples" /tmp/example | |
fi | |
if [[ -f "README.md" ]]; then | |
mv README.md /tmp/README.md | |
fi | |
if [[ -f "LICENSE.md" ]]; then | |
mv LICENSE.md /tmp/LICENSE.md | |
fi | |
if [[ -f "CHANGELOG.md" ]]; then | |
mv CHANGELOG.md /tmp/CHANGELOG.md | |
fi | |
git checkout package | |
if [[ -f "/tmp/LICENSE.md" ]]; then | |
mv /tmp/LICENSE.md LICENSE.md | |
git add LICENSE.md | |
fi | |
if [[ -f "/tmp/README.md" ]]; then | |
mv /tmp/README.md README.md | |
git add README.md | |
fi | |
if [[ -f "/tmp/CHANGELOG.md" ]]; then | |
mv /tmp/CHANGELOG.md CHANGELOG.md | |
git add CHANGELOG.md | |
fi | |
if [[ -d "/tmp/example" ]]; then | |
mkdir "Samples~" | |
mv /tmp/example/* "Samples~/" | |
git add "Samples~" | |
fi | |
if [[ -d "Tests" ]]; then | |
rm -rf Tests | |
rm -f Tests.meta | |
fi | |
git config --global user.name 'github-bot' | |
git config --global user.email '[email protected]' | |
git commit -am "Packaged project" | |
git push -f -u origin package | |
git tag -a ${{ steps.previoustag.outputs.tag }}-upm -m "${{ steps.previoustag.outputs.tag }}" | |
git push origin ${{ steps.previoustag.outputs.tag }}-upm | |
env: | |
PKG_ROOT: "Packages/se.hertzole.scriptable-values" |