From 4f0d36a5fe1706e6f7fcd9a7eb1d13f849ee3db1 Mon Sep 17 00:00:00 2001 From: Camille Galladjov Date: Sat, 15 Feb 2020 17:25:47 +0300 Subject: [PATCH] [CI] automated UPM release configuration --- .github/workflows/upm-release.yml | 87 +++++++++++++++++++++++++++++++ package.json | 15 ++++++ version.json | 3 ++ 3 files changed, 105 insertions(+) create mode 100644 .github/workflows/upm-release.yml create mode 100644 package.json create mode 100644 version.json diff --git a/.github/workflows/upm-release.yml b/.github/workflows/upm-release.yml new file mode 100644 index 0000000..130af30 --- /dev/null +++ b/.github/workflows/upm-release.yml @@ -0,0 +1,87 @@ +name: UPM Release + +on: + push: + branches: + - master + paths: + - version.json + - ".github/workflows/upm-release.yml" + +jobs: + build: + env: + PKG_ROOT: Svelto.ECS + VERSION_JSON: version.json + PKG_JSON: package.json + LICENSE: LICENSE + README: README.md + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: copy package to temp + run: | + mkdir temp + cp -r $PKG_ROOT temp + cp $VERSION_JSON temp + cp $PKG_JSON temp + cp $LICENSE temp + cp $README temp + + - name: checkout upm branch + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git checkout UPM + + - name: get preparation tools + run: git clone https://github.com/Ujinjinjin/upm-preparator.git --branch v1.0.9 --single-branch + + - name: bump package version + run: | + python3 upm-preparator/version_bumpinator.py "temp/version.json" "temp/package.json" + rm "temp/version.json" + + - name: change project structure + run: python3 upm-preparator/structure_changinator.py "temp/${PKG_ROOT}" + + - name: move package.json & LICENSE & README from temp to root + run: | + mv "temp/package.json" . + mv "temp/LICENSE" . + mv "temp/README.md" . + + - name: generate meta files + run: python3 upm-preparator/meta_makinator.py + + - name: remove preparation tools and temp + run: | + rm -rf upm-preparator + rm -rf temp + + - name: config git data + run: | + git config --global user.email "noreply@github.com" + git config --global user.name "GitHub" + + - name: commit, tag and push changes + run: | + git add -A + git commit -m "UPM package version ${PKG_VERSION}" + git push origin UPM + git tag $(echo $PKG_VERSION) + git push origin $(echo $PKG_VERSION) + + - name: create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.PKG_VERSION }} + release_name: "UPM ${{ env.PKG_VERSION }}" + body: "-" + draft: false + prerelease: false diff --git a/package.json b/package.json new file mode 100644 index 0000000..d3584ee --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "displayName": "Svelto ECS", + "category": "Svelto", + "description": "Svelto ECS C# Lightweight Data Oriented Entity Component System Framework", + "dependencies": { + "com.sebaslab.svelto.common": "2.9.7" + }, + "keywords": [ + "svelto" + ], + "name": "com.sebaslab.svelto.ecs", + "unity": "2019.2", + "version": "2.9.7", + "type": "framework" + } \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 0000000..e6cde15 --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "version": "2.9.8" +} \ No newline at end of file