From 94f5ff3d900f80494e3560bb6b1205f29998b9f6 Mon Sep 17 00:00:00 2001 From: lpierabella <77288191+lpierabella@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:00:52 +0200 Subject: [PATCH 1/3] added action to trigger manually that automate release process --- .github/workflows/release.yml | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d6f79905 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,67 @@ +name: Relase new official MSFS IO +on: + workflow_dispatch: + inputs: + version: + description: 'Version number' + required: true + default: '0,0,0' + +jobs: + increase_and_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Define Tag + run: | + v=${{github.event.inputs.version}} + version=${v//[,]/.} + echo "OFFICIAL_VERSION=$version" >> $GITHUB_ENV + + - name: Print Tag + run: echo version is ${{env.OFFICIAL_VERSION}} + + - name: Find and Replace + uses: jacobtomlinson/gha-find-replace@v2 + with: + find: '"version": \((.*)\)' + replace: '"version": (${{github.event.inputs.version}})' + include: "addons\io_scene_gltf2_msfs\__init__.py" + - name: Log File Content + run: cat addons\io_scene_gltf2_msfs\__init__.py + - name: Setup git config + run: | + # setup the username and email. + git config user.name "GitHub Actions Bot" + git config user.email "<>" + - name: Commit and push + run: | + # Stage the file, commit and push + git add subfolder/__init__.py + git commit -m "updated version" + git push origin main + - name: Update Release branch + run: | + # Stage the file, commit and push + git checkout release + git merge --squash main + git push origin release + git tag "v${{env.OFFICIAL_VERSION}}" + git push origin release --tags + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions + with: + tag_name: ${{env.OFFICIAL_VERSION}} + release_name: Release ${{env.OFFICIAL_VERSION}} + body: | + Official MSFS Blender IO v${{env.OFFICIAL_VERSION}} + draft: true + prerelease: false + \ No newline at end of file From a74cd172be5b22e18a8830795b06e21361eeeabb Mon Sep 17 00:00:00 2001 From: lpierabella <77288191+lpierabella@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:03:07 +0200 Subject: [PATCH 2/3] fix path syntax --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6f79905..80c9ca2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,9 +30,9 @@ jobs: with: find: '"version": \((.*)\)' replace: '"version": (${{github.event.inputs.version}})' - include: "addons\io_scene_gltf2_msfs\__init__.py" + include: "addons\\io_scene_gltf2_msfs\\__init__.py" - name: Log File Content - run: cat addons\io_scene_gltf2_msfs\__init__.py + run: cat addons\\io_scene_gltf2_msfs\\__init__.py - name: Setup git config run: | # setup the username and email. From 83eb1eeccc071f9ba41a104c8ae59ff01e46c6d9 Mon Sep 17 00:00:00 2001 From: lpierabella <77288191+lpierabella@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:05:37 +0200 Subject: [PATCH 3/3] fix _init__.py paths --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80c9ca2e..8c691f51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,9 +30,9 @@ jobs: with: find: '"version": \((.*)\)' replace: '"version": (${{github.event.inputs.version}})' - include: "addons\\io_scene_gltf2_msfs\\__init__.py" + include: "addons/io_scene_gltf2_msfs/__init__.py" - name: Log File Content - run: cat addons\\io_scene_gltf2_msfs\\__init__.py + run: cat addons/io_scene_gltf2_msfs/__init__.py - name: Setup git config run: | # setup the username and email. @@ -41,7 +41,7 @@ jobs: - name: Commit and push run: | # Stage the file, commit and push - git add subfolder/__init__.py + git add addons/io_scene_gltf2_msfs/__init__.py git commit -m "updated version" git push origin main - name: Update Release branch