-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (79 loc) · 2.62 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Deploy
# Put your personal access token in a repository secret named PAT for cross-repository access
permissions:
contents: write
on:
workflow_dispatch:
push:
paths-ignore:
- '*.md'
branches:
- master
- main
- release
env:
INTERNAL_NAME: PositionalGuide
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
jobs:
precheck:
runs-on: ubuntu-latest
outputs:
buildVersion: ${{ steps.data.outputs.buildVersion }}
tagName: ${{ steps.data.outputs.tagName }}
tagExists: ${{ steps.check-version-tag.outputs.tagExists }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Load values
id: data
run: |
buildVersion=$(grep -Ei '<version>[^<]+</version>' "${{ env.INTERNAL_NAME }}/${{ env.INTERNAL_NAME }}.csproj" | sed -e 's/.\+<version>\([^<]\+\)<.\+/\1/i' -)
echo "buildVersion=$buildVersion" >> "$GITHUB_OUTPUT"
echo "tagName=v$buildVersion" >> "$GITHUB_OUTPUT"
shell: bash
- name: Check if version exists
id: check-version-tag
run: |
if git show-ref --quiet --tags "${{ steps.data.outputs.tagName }}"; then echo "tagExists=true" >> "$GITHUB_OUTPUT"; else echo "tagExists=false" >> "$GITHUB_OUTPUT"; fi
shell: bash
- name: Debug
run: |
echo "Current version is ${{ steps.data.outputs.buildVersion }} for tag ${{ steps.data.outputs.tagName }} (exists = ${{ steps.check-version-tag.outputs.tagExists }})"
shell: bash
build:
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: 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: tag
runs-on: ubuntu-latest
steps:
- name: Submit pull request
uses: daemitus/DalamudPluginPR2@master
with:
token: ${{ secrets.PAT }}
plugin_name: ${{ env.INTERNAL_NAME }}
plugin_owners: PrincessRTFM