From 578eb8c332810656842f72e0bb94bb0d4dcb9f5e Mon Sep 17 00:00:00 2001 From: Hop311 Date: Tue, 16 May 2023 22:49:52 +0100 Subject: Changed from OpenVic2 to OpenVic --- .github/actions/openvic-env/action.yml | 33 +++++++++++++++++++++++++++++++++ .github/actions/openvic2-env/action.yml | 33 --------------------------------- .github/workflows/builds.yml | 22 +++++++++++----------- 3 files changed, 44 insertions(+), 44 deletions(-) create mode 100644 .github/actions/openvic-env/action.yml delete mode 100644 .github/actions/openvic2-env/action.yml (limited to '.github') diff --git a/.github/actions/openvic-env/action.yml b/.github/actions/openvic-env/action.yml new file mode 100644 index 0000000..acb428f --- /dev/null +++ b/.github/actions/openvic-env/action.yml @@ -0,0 +1,33 @@ +name: Setup OpenVic Environment +description: Setup OpenVic Environment +runs: + using: "composite" + steps: + - name: Setup Environment + uses: actions/github-script@v6 + with: + script: | + const commit_name = 'OPENVIC_COMMIT'; + const tag_name = 'OPENVIC_TAG'; + const release_name = 'OPENVIC_RELEASE'; + var commit_sha = process.env["GITHUB_SHA"]; + if(context.eventName === 'pull_request') { + commit_sha = context.payload.pull_request.head.sha; + } + core.exportVariable(commit_name, commit_sha); + try { + const release = await github.rest.repos.getLatestRelease({owner: context.repo.owner, repo: context.repo.repo}); + core.exportVariable(tag_name, release.data["tag_name"]); + core.exportVariable(release_name, release.data["name"]); + } catch(error) { + if (error.response.status != 404) throw error; + const tagList = await github.rest.repos.listTags({owner: context.repo.owner, repo: context.repo.repo}); + if (tagList.data.length == 0) { + core.warning("Could not list tags, this repo has no tags on it, setting tag_name and release_name environment variables to '' and '', you can fetch tags with 'git fetch --tags' ' and push tags with 'git push --tags"); + core.exportVariable(tag_name, `<${context.repo.owner}/${context.repo.repo}-NoTag>`); + core.exportVariable(release_name, `<${context.repo.owner}/${context.repo.repo}-NoRelease>`); + } else { + core.exportVariable(tag_name, tagList.data[0].name); + core.exportVariable(release_name, tagList.data[0].name); + } + } \ No newline at end of file diff --git a/.github/actions/openvic2-env/action.yml b/.github/actions/openvic2-env/action.yml deleted file mode 100644 index 8fea1b3..0000000 --- a/.github/actions/openvic2-env/action.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Setup OpenVic2 Environment -description: Setup OpenVic2 Environment -runs: - using: "composite" - steps: - - name: Setup Environment - uses: actions/github-script@v6 - with: - script: | - const commit_name = 'OPENVIC2_COMMIT'; - const tag_name = 'OPENVIC2_TAG'; - const release_name = 'OPENVIC2_RELEASE'; - var commit_sha = process.env["GITHUB_SHA"]; - if(context.eventName === 'pull_request') { - commit_sha = context.payload.pull_request.head.sha; - } - core.exportVariable(commit_name, commit_sha); - try { - const release = await github.rest.repos.getLatestRelease({owner: context.repo.owner, repo: context.repo.repo}); - core.exportVariable(tag_name, release.data["tag_name"]); - core.exportVariable(release_name, release.data["name"]); - } catch(error) { - if (error.response.status != 404) throw error; - const tagList = await github.rest.repos.listTags({owner: context.repo.owner, repo: context.repo.repo}); - if (tagList.data.length == 0) { - core.warning("Could not list tags, this repo has no tags on it, setting tag_name and release_name environment variables to '' and '', you can fetch tags with 'git fetch --tags' ' and push tags with 'git push --tags"); - core.exportVariable(tag_name, `<${context.repo.owner}/${context.repo.repo}-NoTag>`); - core.exportVariable(release_name, `<${context.repo.owner}/${context.repo.repo}-NoRelease>`); - } else { - core.exportVariable(tag_name, tagList.data[0].name); - core.exportVariable(release_name, tagList.data[0].name); - } - } \ No newline at end of file diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 664f8e4..b782ca4 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -61,7 +61,7 @@ jobs: submodules: recursive - name: Setup Environment - uses: ./.github/actions/openvic2-env + uses: ./.github/actions/openvic-env - name: Set up Python uses: actions/setup-python@v4 @@ -97,28 +97,28 @@ jobs: - name: Delete compilation files if: ${{ matrix.platform == 'windows' }} run: | - Remove-Item game/bin/openvic2/* -Include *.exp,*.lib,*.pdb -Force + Remove-Item game/bin/openvic/* -Include *.exp,*.lib,*.pdb -Force - name: Upload extension artifact uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-extension path: | - ${{ github.workspace }}/game/bin/openvic2/* + ${{ github.workspace }}/game/bin/openvic/* - name: Archive Release uses: thedoctor0/zip-release@0.7.1 with: type: 'zip' - filename: 'libopenvic2.${{ matrix.platform }}.${{ matrix.arch }}.zip' - path: '${{ github.workspace }}/game/bin/openvic2/' + filename: 'libopenvic.${{ matrix.platform }}.${{ matrix.arch }}.zip' + path: '${{ github.workspace }}/game/bin/openvic/' if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - name: Create and upload asset uses: ncipollo/release-action@v1 with: allowUpdates: true - artifacts: "libopenvic2.${{ matrix.platform }}.${{ matrix.arch }}.zip" + artifacts: "libopenvic.${{ matrix.platform }}.${{ matrix.arch }}.zip" omitNameDuringUpdate: true omitBodyDuringUpdate: true token: ${{ secrets.GITHUB_TOKEN }} @@ -135,13 +135,13 @@ jobs: uses: actions/checkout@v3.3.0 - name: Setup Environment - uses: ./.github/actions/openvic2-env + uses: ./.github/actions/openvic-env - name: Download artifact uses: actions/download-artifact@v3 with: name: ${{ github.event.repository.name }}-extension - path: game/bin/openvic2 + path: game/bin/openvic - name: Export pack file id: export_game @@ -154,7 +154,7 @@ jobs: export_debug: true relative_export_path: ./game/export - - run: mv "./game/export/LinuxX11 x86_64/OpenVic2.x86_64.pck" ./game/export/${{ github.event.repository.name }}.pck + - run: mv "./game/export/LinuxX11 x86_64/OpenVic.x86_64.pck" ./game/export/${{ github.event.repository.name }}.pck - name: Upload pack artifact uses: actions/upload-artifact@v3 @@ -176,13 +176,13 @@ jobs: uses: actions/checkout@v3.3.0 - name: Setup Environment - uses: ./.github/actions/openvic2-env + uses: ./.github/actions/openvic-env - name: Download artifact uses: actions/download-artifact@v3 with: name: ${{ github.event.repository.name }}-extension - path: game/bin/openvic2 + path: game/bin/openvic - name: Install WINE id: wine_install -- cgit v1.2.3-56-ga3b1