-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.74 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
name: auto-rmskin-package
on:
release:
types:
- created
jobs:
package:
runs-on: windows-latest
outputs:
target: ${{ steps.create_rmskin.outputs.target }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create rmskin
shell: powershell
id: create_rmskin
run: |
Write-Output "Compressing archive: RMSKIN/*"
$target = "${{ github.event.repository.name }}_${{ github.event.release.tag_name }}.zip"
Compress-Archive -Path ./RMSKIN/* -DestinationPath $target
Write-Output "Archive: $target"
Write-Output "Writing footer..."
$size = [long](Get-Item $target).length
$size_bytes = [System.BitConverter]::GetBytes($size)
Add-Content -Path $target -Value $size_bytes -Encoding Byte
$flags = [byte]0
Add-Content -Path $target -Value $flags -Encoding Byte
$rmskin = [string]"RMSKIN`0"
Add-Content -Path $target -Value $rmskin -NoNewLine -Encoding ASCII
Write-Output "Changing .zip to .rmskin"
Rename-Item -Path $target -NewName ([io.path]::ChangeExtension($target, '.rmskin'))
$target = $target.Replace(".zip", ".rmskin")
Write-Output "File to upload: $target"
echo "::set-output name=target::$target"
- name: Upload rmskin
id: upload_rmskin
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ steps.create_rmskin.outputs.target }}
asset_path: ${{ steps.create_rmskin.outputs.target }}
asset_content_type: application/octet-stream