Skip to content

Merge pull request #78 from lichie567/develop #25

Merge pull request #78 from lichie567/develop

Merge pull request #78 from lichie567/develop #25

Workflow file for this run

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: LMeter-release-${{ github.sha }}
path: |
LMeter/bin/x64/Release
!LMeter/bin/x64/Release/LMeter
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: LMeter ${{ 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: ./LMeter/bin/x64/Release/LMeter/latest.zip
asset_name: LMeter.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