Skip to content

Commit

Permalink
Attempt fixing deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Aug 14, 2021
1 parent c72bf12 commit 8982ae0
Showing 1 changed file with 61 additions and 76 deletions.
137 changes: 61 additions & 76 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,77 @@ name: deploy
on:
push:
tags:
- 'v*.*.*'
- "v*.*.*"

jobs:

create-binaries:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Install nasm
run: |
$NASM_VERSION="2.15.05"
$LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip"
7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm"
echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable-x86_64-pc-windows-gnu
override: true

- name: Install cargo-c
run: |
cargo install cargo-c
- name: Build
run: |
cargo build --release
- name: Run cargo-c
run: |
cargo cinstall --release --destdir="C:\"
- name: Create zip
run: |
$METRICS_PATH="$Env:GITHUB_WORKSPACE\target\release"
7z a av-scenechange.zip `
"$METRICS_PATH\av-scenechange.exe" "C:\usr\local"
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: av-scenechange-bins
path: av-scenechange.zip
- uses: actions/checkout@v2

- name: Install nasm
run: |
$NASM_VERSION="2.15.05"
$LINK="https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
curl -LO "$LINK/nasm-$NASM_VERSION-win64.zip"
7z e -y "nasm-$NASM_VERSION-win64.zip" -o"C:\nasm"
echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable-x86_64-pc-windows-gnu
override: true

- name: Build
run: |
cargo build --release
- name: Create zip
run: |
$METRICS_PATH="$Env:GITHUB_WORKSPACE\target\release"
7z a av-scenechange.zip `
"$METRICS_PATH\av-scenechange.exe"
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: av-scenechange-bins
path: av-scenechange.zip

deploy:

needs: create-binaries

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Download the zip
uses: actions/download-artifact@v2

- name: Unzip av-scenechange Windows binaries
run: |
unzip av-scenechange-bins/av-scenechange.zip -d av-scenechange-bins
- name: Handle release data and files
id: data
run: |
VERSION=$(head -n 1 CHANGELOG.md | tr -d "## Version ")
FILENAME=av-scenechange-$VERSION-windows-sdk
echo "::set-output name=version::$VERSION"
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
cd av-scenechange-bins
mv local $FILENAME
zip -r $FILENAME.zip $FILENAME
strip av-scenechange.exe
mv $FILENAME.zip av-scenechange.exe ..
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.data.outputs.version }}
body_path: CHANGELOG.txt
files: |
av-scenechange-${{ steps.data.outputs.version }}-windows-sdk.zip
av-scenechange.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2

- name: Download the zip
uses: actions/download-artifact@v2

- name: Unzip av-scenechange Windows binaries
run: |
unzip av-scenechange-bins/av-scenechange.zip -d av-scenechange-bins
- name: Handle release data and files
id: data
run: |
VERSION=$(head -n 1 CHANGELOG.md | tr -d "## Version ")
echo "::set-output name=version::$VERSION"
tail -n +2 CHANGELOG.md | sed -e '/^$/,$d' > CHANGELOG.txt
cd av-scenechange-bins
strip av-scenechange.exe
mv av-scenechange.exe ..
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: Version ${{ steps.data.outputs.version }}
body_path: CHANGELOG.txt
files: |
av-scenechange.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8982ae0

Please sign in to comment.