mirror of
https://github.com/house-of-vanity/khm.git
synced 2025-08-21 14:27:14 +00:00
Update main.yml
This commit is contained in:
committed by
GitHub
parent
ca7ca3dc38
commit
faacf4c034
65
.github/workflows/main.yml
vendored
65
.github/workflows/main.yml
vendored
@@ -41,20 +41,20 @@ jobs:
|
|||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
uses: gmiam/rust-musl-action@master
|
uses: gmiam/rust-musl-action@master
|
||||||
with:
|
with:
|
||||||
args: cargo build --target $BUILD_TARGET --release
|
args: cargo build --target ${{ matrix.build_target }} --release
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
if: matrix.os != 'ubuntu-latest'
|
if: matrix.os != 'ubuntu-latest'
|
||||||
run: cargo build --target ${{ matrix.build_target }} --release
|
run: cargo build --target ${{ matrix.build_target }} --release
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Upload artifact
|
||||||
name: Upload artifact
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
path: target/${{ matrix.build_target }}/release/${{ env.BINARY_NAME }}*
|
path: target/${{ matrix.build_target }}/release/${{ env.BINARY_NAME }}*
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Making New Release ^_^
|
name: Create and upload release
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -65,22 +65,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "REF_TYPE=$(echo ${GITHUB_REF} | cut -d'/' -f2)" >> $GITHUB_ENV
|
echo "REF_TYPE=$(echo ${GITHUB_REF} | cut -d'/' -f2)" >> $GITHUB_ENV
|
||||||
echo "REF_NAME=$(echo ${GITHUB_REF} | cut -d'/' -f3)" >> $GITHUB_ENV
|
echo "REF_NAME=$(echo ${GITHUB_REF} | cut -d'/' -f3)" >> $GITHUB_ENV
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
name: Download Linux binary
|
|
||||||
id: download_linux_binary
|
|
||||||
with:
|
|
||||||
name: ${{ env.BINARY_NAME }}_linux-amd64
|
|
||||||
path: ${{ env.BINARY_NAME }}_linux-amd64
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
name: Download Windows artifact
|
|
||||||
id: download_windows_binary
|
|
||||||
with:
|
|
||||||
name: ${{ env.BINARY_NAME }}_windows-amd64
|
|
||||||
path: ${{ env.BINARY_NAME }}_windows-amd64
|
|
||||||
- name: LS
|
|
||||||
run: |
|
|
||||||
ls -lah
|
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
@@ -91,21 +75,34 @@ jobs:
|
|||||||
release_name: Release ${{ github.ref }}
|
release_name: Release ${{ github.ref }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- name: Upload Linux Release Asset
|
|
||||||
uses: actions/upload-release-asset@master
|
upload:
|
||||||
|
name: Upload Release Assets
|
||||||
|
needs: release
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform_name: linux-amd64
|
||||||
|
- os: windows-latest
|
||||||
|
platform_name: windows-amd64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
name: Download ${ env.BINARY_NAME }_${{ matrix.platform_name }} artifact
|
||||||
|
with:
|
||||||
|
name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
path: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
- name: List downloaded binaries
|
||||||
|
run: ls -lah ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
- name: Upload Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ needs.release.outputs.create_release.upload_url }}
|
||||||
asset_path: ${{ env.BINARY_NAME }}_linux-amd64/${{ env.BINARY_NAME }}
|
asset_path: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}/${{ env.BINARY_NAME }}${{ matrix.platform_name == 'windows-amd64' && '.exe' || '' }}
|
||||||
asset_name: ${{ env.BINARY_NAME }}_linux-amd64
|
asset_name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}${{ matrix.platform_name == 'windows-amd64' && '.exe' || '' }}
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
- name: Upload Windows Release Asset
|
|
||||||
uses: actions/upload-release-asset@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ${{ env.BINARY_NAME }}_windows-amd64/${{ env.BINARY_NAME }}.exe
|
|
||||||
asset_name: ${{ env.BINARY_NAME }}_windows-amd64
|
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
Reference in New Issue
Block a user