diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..7ddb5b1 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,48 @@ +name: Compile + +# Put your personal access token in a repository secret named PAT for cross-repository access +permissions: + contents: write + +on: + workflow_dispatch: + workflow_call: + pull_request: + paths-ignore: + - '*.md' + branches: + - master + - main + - release + +env: + INTERNAL_NAME: PositionalGuide + CONFIGURATION: Release + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_NOLOGO: true + +jobs: + build: + runs-on: windows-2022 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1.3 + - name: Download Dalamud + run: | + Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip + Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" + - name: Restore + run: dotnet restore -r win + - name: Build + run: dotnet build -c ${{ env.CONFIGURATION }} --no-restore + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: PluginRepoZip + path: ${{ env.INTERNAL_NAME }}/bin/${{ env.CONFIGURATION }}/${{ env.INTERNAL_NAME }} + if-no-files-found: error + retention-days: 14 diff --git a/.github/workflows/build.yml b/.github/workflows/deploy.yml similarity index 59% rename from .github/workflows/build.yml rename to .github/workflows/deploy.yml index 6aa97fe..ee8fa8b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Build +name: Deploy # Put your personal access token in a repository secret named PAT for cross-repository access permissions: @@ -52,43 +52,28 @@ jobs: needs: precheck if: needs.precheck.outputs.tagExists == 'false' runs-on: windows-2022 + uses: ./.github/workflows/compile.yml + tag: + needs: + - precheck + - build + if: needs.precheck.outputs.tagExists == 'false' steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1.3 - - name: Download Dalamud - run: | - Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip - Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" - - name: Restore - run: dotnet restore -r win - - name: Build - run: dotnet build -c ${{ env.CONFIGURATION }} --no-restore - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: PluginRepoZip - path: ${{ env.INTERNAL_NAME }}/bin/${{ env.CONFIGURATION }}/${{ env.INTERNAL_NAME }} - if-no-files-found: error - retention-days: 14 - - name: Tag - run: | - git tag -am "[Automated build $BUILD_VERSION]" "$TAG_NAME" - git push origin "$TAG_NAME" - shell: bash - env: - BUILD_VERSION: ${{ needs.precheck.outputs.buildVersion }} - TAG_NAME: ${{ needs.precheck.outputs.tagName }} - GIT_AUTHOR_NAME: GitHub Action - GIT_COMMITTER_NAME: GitHub Action - GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com - GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + - name: Tag release commit + run: | + git tag -am "[Automated build $BUILD_VERSION]" "$TAG_NAME" + git push origin "$TAG_NAME" + shell: bash + env: + BUILD_VERSION: ${{ needs.precheck.outputs.buildVersion }} + TAG_NAME: ${{ needs.precheck.outputs.tagName }} + GIT_AUTHOR_NAME: GitHub Action + GIT_COMMITTER_NAME: GitHub Action + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com deploy: - needs: build + needs: tag runs-on: ubuntu-latest steps: - name: Submit pull request