-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.12 KB
/
release.yaml
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
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: Calculate Version from xxHash3
id: calculate_version
run: |
apt-get update && apt-get install -y xxhash
version_hash=$(xxhsum -H3 ./minimal_hashes.nx | awk '{print $1}')
echo "Calculated version hash: $version_hash"
echo "::set-output name=version::$version_hash"
- name: Create Tag
run: |
git tag "v${{ steps.calculate_version.outputs.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: "version-${{ steps.calculate_version.outputs.version }}"
release_name: "Release version-${{ steps.calculate_version.outputs.version }}"
draft: false
prerelease: false
- name: Upload .nx File to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./minimal_hashes.nx
asset_name: minimal_hashes.nx
asset_content_type: application/octet-stream