ci: add rust caching and safe in-place release publishing
This commit is contained in:
parent
6f7977c734
commit
6a20bcfec5
1 changed files with 26 additions and 4 deletions
30
.github/workflows/release.yml
vendored
30
.github/workflows/release.yml
vendored
|
|
@ -5,6 +5,12 @@ on:
|
|||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release Tag (e.g. v2.2.3)'
|
||||
required: false
|
||||
default: 'v2.2.3'
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
@ -54,6 +60,12 @@ jobs:
|
|||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.target }}
|
||||
cache-all-crates: true
|
||||
|
||||
- name: Install Linux build dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
|
|
@ -112,7 +124,7 @@ jobs:
|
|||
create-release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
|
@ -120,15 +132,25 @@ jobs:
|
|||
path: ./artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Determine Release Tag
|
||||
id: release_tag
|
||||
run: |
|
||||
if [[ "${{ github.ref_name }}" =~ ^v ]]; then
|
||||
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||
elif [ -n "${{ inputs.tag }}" ]; then
|
||||
echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "tag=v2.2.3" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Publish GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ./artifacts/**/*
|
||||
tag_name: ${{ github.ref_name }}
|
||||
tag_name: ${{ steps.release_tag.outputs.tag }}
|
||||
name: "OneLauncher-Cracked ${{ steps.release_tag.outputs.tag }}"
|
||||
draft: false
|
||||
prerelease: false
|
||||
generate_release_notes: true
|
||||
make_latest: true
|
||||
fail_on_unmatched_files: false
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue