Skip to content

Commit

Permalink
Updating release workflow to try and get automatic release artifacts …
Browse files Browse the repository at this point in the history
…working.
  • Loading branch information
ursuscamp committed Sep 5, 2022
1 parent eaa8f64 commit ed8f85a
Showing 1 changed file with 62 additions and 35 deletions.
97 changes: 62 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,67 @@ on:
types: [created]

jobs:
build:
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@master
- run: cargo build --release
- run: zip -j brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip target/release/brainseed
if: runner.os != 'Windows'
- run: Compress-Archive -Path .\target\release\brainseed.exe -DestinationPath .\brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip
if: runner.os == 'Windows'
- name: Archive zip file
uses: actions/upload-artifact@v3
with:
name: brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip
path: '*.zip'
# build:
# name: build ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - macos-latest
# - ubuntu-latest
# - windows-latest
# steps:
# - uses: actions/checkout@master
# - run: cargo build --release
# - run: zip -j brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip target/release/brainseed
# if: runner.os != 'Windows'
# - run: Compress-Archive -Path .\target\release\brainseed.exe -DestinationPath .\brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip
# if: runner.os == 'Windows'
# - name: Archive zip file
# uses: actions/upload-artifact@v3
# with:
# name: brainseed-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.zip
# path: '*.zip'


upload:
name: release ${{ matrix.os }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Upload the zips files
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: '*.zip'
# upload:
# name: release ${{ matrix.os }}
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v3
# - name: Upload the zips files
# uses: skx/github-action-publish-binaries@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# args: '*.zip'
publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: brainseed
asset_name: brainseed-linux-amd64
- os: windows-latest
artifact_name: brainseed.exe
asset_name: brainseed-windows-amd64
- os: macos-latest
artifact_name: brainseed
asset_name: brainseed-macos-amd64

steps:
- uses: actions/checkout@master
- name: Build
run: cargo build --release --locked
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

0 comments on commit ed8f85a

Please sign in to comment.