v1.4.2 #13
Workflow file for this run
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
# Taken from https://github.com/brianferguson/auto-rmskin-package/blob/e4810692822c8e1b9ed3b89993ed9a50d2a8f251/.github/workflows/release.yml | |
name: auto-rmskin-package | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
lastTag: ${{ steps.get_last_tag.outputs.lastTag }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get last tag | |
id: get_last_tag | |
run: | | |
git fetch --tags | |
echo "lastTag=$(git tag --sort=-creatordate | awk 'NR==2')" >> "$GITHUB_OUTPUT" | |
- name: Update version | |
run: | | |
git checkout main | |
find ./RMSKIN -type f -exec sed -i 's/${{ steps.get_last_tag.outputs.lastTag }}/${{ github.event.release.tag_name }}/g' {} \; | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add . | |
git commit -m "Bump version" | |
git push | |
package: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
outputs: | |
target: ${{ steps.create_rmskin.outputs.target }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create rmskin | |
shell: powershell | |
id: create_rmskin | |
run: | | |
git checkout main | |
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/[email protected] | |
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 |