Skip to content

fix publish task

fix publish task #5

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
license-check:
runs-on: ubuntu-latest
name: check-license
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: |
cargo make license
create-release:
needs: [license-check]
name: create-github-release
runs-on: ubuntu-latest
steps:
- id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
- run: |
echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
echo "${{ steps.create_release.outputs.id }}" > release_id.txt
- uses: actions/upload-artifact@v4
with:
name: release_url
path: release_url.txt
- uses: actions/upload-artifact@v4
with:
name: release_id
path: release_id.txt
publish-release:
needs: [create-release]
name: upload-release-asset-${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: win
arch: x64
- os: ubuntu-latest
name: linux
arch: x64
- os: macos-latest
name: macos
arch: aarch64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
- id: get_version
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
return 'autd3-'+context.payload.ref.replace(/refs\/tags\//, '')+'-${{ matrix.name }}-${{ matrix.arch }}';
- run: cargo make publish
- run: Compress-Archive -Path LICENSE, bin, ThirdPartyNotice.txt -DestinationPath assets-shared.zip
if: ${{ matrix.os == 'windows-latest' }}
- run: tar -zcvf assets-shared.tar.gz bin LICENSE ThirdPartyNotice.txt
if: ${{ matrix.os != 'windows-latest' }}
- uses: actions/download-artifact@v4
with:
name: release_url
- id: get_release_info
uses: juliangruber/read-file-action@v1
with:
path: release_url.txt
- uses: shogo82148/actions-upload-release-asset@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
upload_url: ${{ steps.get_release_info.outputs.content }}
asset_path: ./assets-shared.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}
asset_name: ${{ steps.get_version.outputs.result }}-shared.${{ matrix.os == 'windows-latest' && 'zip' || 'tar.gz' }}
asset_content_type: ${{ matrix.os == 'windows-latest' && 'application/zip' || 'application/octet-stream' }}