Skip to content

Commit

Permalink
workflow improvements, I hope
Browse files Browse the repository at this point in the history
  • Loading branch information
PrincessRTFM committed Jan 13, 2024
1 parent 885fc15 commit 00593d8
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 35 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
- 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
55 changes: 20 additions & 35 deletions .github/workflows/build.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Deploy

# Put your personal access token in a repository secret named PAT for cross-repository access
permissions:
Expand Down Expand Up @@ -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/[email protected]
- 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
Expand Down

0 comments on commit 00593d8

Please sign in to comment.