Update release.yaml #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pack JSON Folder and Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
pack-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Download NexusMods.Archives.Nx Repository | |
run: | | |
git clone https://github.com/Nexus-Mods/NexusMods.Archives.Nx.git | |
- name: Set Up .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x' | |
- name: Restore Dependencies for NexusMods.Archives.Nx.Cli | |
run: | | |
cd NexusMods.Archives.Nx/NexusMods.Archives.Nx.Cli | |
dotnet restore | |
- name: Pack JSON Folder | |
run: | | |
dotnet run --project NexusMods.Archives.Nx/NexusMods.Archives.Nx.Cli/NexusMods.Archives.Nx.Cli.csproj -- pack --source ./json --target ./minimal_hashes.nx --deduplicate-chunked=true --chunkedlevel=22 | |
- name: Create Tag | |
run: | | |
version="v$(echo $GITHUB_RUN_ID)" | |
git tag $version | |
git push origin --tags | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "v${{ github.run_id }}" | |
release_name: "Release ${{ github.run_id }}" | |
draft: false | |
prerelease: false | |
- name: Upload .nx File to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
asset_path: ./minimal_hashes.nx | |
asset_name: minimal_hashes.nx | |
asset_content_type: application/octet-stream |