This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 40
77 lines (67 loc) · 2.57 KB
/
release.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
name: Release
on:
push:
tags:
- '*'
jobs:
build-release:
runs-on: windows-latest
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- name: Checkout and initialise
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Dalamud
shell: pwsh
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile ./latest.zip
Expand-Archive -Path ./latest.zip ./dalamud
- name: Restore project dependencies
run: dotnet restore --verbosity normal
- name: Build Release
run: dotnet build --no-restore --verbosity normal --configuration Release
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: XIVAuras-release-${{ github.sha }}
path: |
XIVAuras/bin/x64/Release
!XIVAuras/bin/x64/Release/XIVAuras
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: XIVAuras ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./XIVAuras/bin/x64/Release/XIVAuras/latest.zip
asset_name: XIVAuras.zip
asset_content_type: application/zip
- name: Write out repo.json
run: |
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
$path = './base_repo.json'
$new_path = './repo.json'
$content = get-content -path $path
$content = $content -replace '1.0.0.0',$ver
set-content -Path $new_path -Value $content
- name: Commit repo.json
run: |
git config --global user.name "Actions User"
git config --global user.email "[email protected]"
git fetch origin main && git checkout main
git add repo.json
git commit -m "[CI] Updating repo.json for ${{ github.ref }}" || true
git push origin main || true