Skip to content

fix workflow dependency #2

fix workflow dependency

fix workflow dependency #2

name: Build and Release
on:
push:
tags:
- "*"
jobs:
build:
strategy:
matrix:
platform: [macos-arm64, macos-amd64, linux-amd64]
runs-on: macos-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "stable"
- uses: actions/checkout@v4
- run: make ${{ matrix.platform }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}
path: dist/fj_cli-${{ matrix.platform }}
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload-sh:
runs-on: ubuntu-latest
needs: [build, create-release]
steps:
- uses: actions/checkout@main
- uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: fj.sh
asset_name: fj.sh
asset_content_type: application/octet-stream
upload-bin:
runs-on: ubuntu-latest
needs: [build, create-release]
strategy:
matrix:
platform: [macos-arm64, macos-amd64, linux-amd64]
steps:
- uses: actions/download-artifact@main
with:
name: ${{ matrix.platform }}
path: ${{ matrix.platform }}
- uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ matrix.platform }}/fj_cli-${{ matrix.platform }}
asset_name: fj_cli-${{ matrix.platform }}
asset_content_type: application/octet-stream