Skip to content

Update repo.json

Update repo.json #51

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

you may only define one of `tags` and `tags-ignore` for a single event
# Add a concurrency group incase a tag is created, deleted, and then recreated while a release is in progress.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Only run this workflow when a tag is pushed when the tag starts with "v".
on:
push:
tags:
- "v*"
tags-ignore:
- "testing_*"
# So we can use the GitHub API to create releases with the run token.
permissions:
contents: write
jobs:
Release:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Meddle/Meddle.Plugin/
shell: bash
env:
DALAMUD_HOME: /tmp/dalamud
IsCI: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true # Grab any submodules that may be required
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Download Dalamud Library
run: |
wget https://goatcorp.github.io/dalamud-distrib/latest.zip -O /tmp/dalamud.zip
unzip /tmp/dalamud.zip -d /tmp/dalamud
- name: Restore Dependencies
run: dotnet restore
- name: Build plugin in release mode
run: |
version=$(echo ${{ github.ref_name }} | sed 's/^v//')
echo "Version: $version"
dotnet build -c Release --no-restore --nologo -o ./bin/Release -p:Version=$version -p:AssemblyVersion=$version -p:FileVersion=$version
- name: Generate Checksums
working-directory: Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin
run: |
sha512sum latest.zip >> checksums.sha512
- name: Zip Blender Plugin
working-directory: Blender/
run: |
zip -r "MeddleTools-${{ github.ref_name }}.zip" .
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/latest.zip
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/checksums.sha512
Blender/MeddleTools-${{ github.ref_name }}.zip
prerelease: false # Releases cant be marked as prereleases as Dalamud wont be able to find them
append_body: true # Append the release notes to the release body
body_path: .github/release-notices.md # These notes are automatically added to the release body every time.
generate_release_notes: true # Automatically makes a release body from PRs since the last release.
fail_on_unmatched_files: true # If the files arent found, fail the workflow and abort the release.
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Release Artifacts
path: |
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/latest.zip
Meddle/Meddle.Plugin/bin/Release/Meddle.Plugin/checksums.sha512
Blender/MeddleTools-${{ github.ref_name }}.zip
- name: Update repo.json
run: |
cd ../../
release_version=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "Release Version: $release_version"
repo_url="$(echo "${{ github.server_url }}/${{ github.repository }}" | sed 's/#/\\#/g')"
echo "Repo URL: $repo_url"
# Update the JSON file using jq
jq --arg release_version "$release_version" \
--arg repo_url "$repo_url/releases/download/${{ github.ref_name }}/latest.zip" \
'.[0].AssemblyVersion = $release_version |
.[0].TestingAssemblyVersion = $release_version |
.[0].DownloadLinkInstall = $repo_url |
.[0].DownloadLinkUpdate = $repo_url |
.[0].DownloadLinkTesting = $repo_url' \
repo.json > repo.json.tmp' repo.json > repo.json.tmp
cat repo.json
git add repo.json
git config --local user.name "github-actions [bot]"
git config --local user.email "[email protected]"
git commit -m "Update repo.json for ${{ github.ref_name }}"
#git push origin HEAD:main