Skip to content

Add --force / -f option for --prune and --remove #7

Add --force / -f option for --prune and --remove

Add --force / -f option for --prune and --remove #7

Workflow file for this run

name: Release
on:
push:
tags: ['v*']
jobs:
build-native:
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
artifact: git-wt-linux-x64
- os: macos-latest
rid: osx-arm64
artifact: git-wt-osx-arm64
- os: windows-latest
rid: win-x64
artifact: git-wt-win-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '10.0.x'
- name: Set version from tag
shell: bash
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Publish native AOT
run: >
dotnet publish src/git-wt/git-wt.csproj
-c Release
-r ${{ matrix.rid }}
-p:Version=${{ env.VERSION }}
-p:PublishAot=true
-o ./publish
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.artifact }}
path: ./publish/git-wt*
release:
needs: build-native
runs-on: ubuntu-latest
environment: nuget
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '10.0.x'
- name: Set version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- run: dotnet restore
- run: dotnet build --no-restore -c Release -p:Version=${{ env.VERSION }}
- run: dotnet test --no-build -c Release
- run: dotnet pack --no-build -c Release -p:Version=${{ env.VERSION }} -o ./artifacts
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Download native binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: ./native
- name: Package native binaries
run: |
cd native
for dir in */; do
name="${dir%/}"
tar -czf "../artifacts/${name}.tar.gz" -C "$dir" .
done
- name: Create GitHub Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
files: artifacts/*
generate_release_notes: true