Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-arm #5

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 100 additions & 48 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,131 @@ name: 'Automatic snapshots'

on:
push:
branches:
- master
paths:
- 'VERSION/**'
# branches:
# - master
# paths:
# - 'VERSION/**'

jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
flag: win-x64
- os: ubuntu-latest
flag: linux-x64
- os: macos-latest
flag: osx-x64

runs-on: ${{ matrix.os }}
build-osx:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'

- run: |
dotnet publish -r ${{ matrix.flag }} -c release -o ./publish-output -p:Version=$(cat ./VERSION/VERSION)
dotnet publish -r osx-x64 -c release -o ./publish-output -p:Version=$(cat ./VERSION/VERSION)
mv ./publish-output/CLI ./publish-output/amcli-osx-x64

- if: ${{ matrix.os != 'windows-latest' }}
- uses: actions/upload-artifact@v3
with:
name: amcli-osx-x64
path: ./publish-output/amcli-osx-x64

build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.100'

- name: 'Install packages'
run: |
mv ./publish-output/CLI ./publish-output/amcli-${{ matrix.flag }}
sudo apt install gcc-multilib -y
sudo apt install libc-dev -y
sudo apt install binutils-aarch64-linux-gnu -y
# dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
# dotnet add package Microsoft.DotNet.ILCompiler --prerelease
# dotnet add package runtime.linux-x64.Microsoft.DotNet.ILCompiler --prerelease

- if: ${{ matrix.os == 'windows-latest' }}
- name: 'Build'
run: |
mv ./publish-output/CLI.exe ./publish-output/amcli-win-x64.exe
dotnet publish -r linux-x64 -c release -o ./publish-output-x64 -p:Version=$(cat ./VERSION/VERSION)
dotnet publish -r linux-arm64 -c release -o ./publish-output-arm64 -p:Version=$(cat ./VERSION/VERSION)
mkdir publish-output
mv ./publish-output-x64/CLI ./publish-output/amcli-linux-x64
mv ./publish-output-arm64/CLI ./publish-output/amcli-linux-arm64

- uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-latest' }}
with:
name: amcli-win-x64
path: ./publish-output/amcli-${{ matrix.flag }}.exe
name: amcli-linux-x64
path: ./publish-output/amcli-linux-x64

- uses: actions/upload-artifact@v3
if: ${{ matrix.os != 'windows-latest' }}
with:
name: amcli-${{ matrix.flag }}
path: ./publish-output/amcli-${{ matrix.flag }}
name: amcli-linux-arm64
path: ./publish-output/amcli-linux-arm64

release:
needs: build
runs-on: ubuntu-latest
build-win:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3

- uses: actions/setup-dotnet@v1
with:
name: amcli-win-x64
- uses: actions/download-artifact@v3
dotnet-version: '7.0.100'

- run: |
dotnet publish -r win-x64 -c release -o ./publish-output-x64 -p:Version=$(cat ./VERSION/VERSION)
dotnet publish -r win-arm64 -c release -o ./publish-output-arm64 -p:Version=$(cat ./VERSION/VERSION)
mkdir publish-output
mv ./publish-output-x64/CLI.exe ./publish-output/amcli-win-x64.exe
mv ./publish-output-arm64/CLI.exe ./publish-output/amcli-win-arm64.exe

- uses: actions/upload-artifact@v3
with:
name: amcli-linux-x64
- uses: actions/download-artifact@v3
name: amcli-win-x64
path: ./publish-output/amcli-win-x64.exe

- uses: actions/upload-artifact@v3
with:
name: amcli-osx-x64
name: amcli-win-arm64
path: ./publish-output/amcli-win-arm64.exe

- run: |
version=$(cat ./VERSION/VERSION)
echo ${{ secrets.CLI_ACCESS_TOKEN }} > token.txt
gh auth login --with-token < token.txt
gh release create v$version \
./amcli-win-x64.exe \
./amcli-linux-x64 \
./amcli-osx-x64 \
-R asc-community/AngouriMathCLI \
-t 'AngouriMath CLI' \
-n 'Expant assets and find the binary for you'

# release:
# needs: build-osx, build-win, build-linux
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/download-artifact@v3
# with:
# name: amcli-win-x64
# - uses: actions/download-artifact@v3
# with:
# name: amcli-linux-x64
# - uses: actions/download-artifact@v3
# with:
# name: amcli-osx-x64
# - uses: actions/download-artifact@v3
# with:
# name: amcli-win-arm64
# - uses: actions/download-artifact@v3
# with:
# name: amcli-linux-arm64
# - uses: actions/download-artifact@v3
# with:
# name: amcli-osx-arm64
#
# - run: |
# version=$(cat ./VERSION/VERSION)
# echo ${{ secrets.CLI_ACCESS_TOKEN }} > token.txt
# gh auth login --with-token < token.txt
# gh release create v$version \
# ./amcli-win-x64.exe \
# ./amcli-linux-x64 \
# ./amcli-osx-x64 \
# ./amcli-win-arm64.exe \
# ./amcli-linux-arm64 \
# ./amcli-osx-arm64 \
# -R asc-community/AngouriMathCLI \
# -t 'AngouriMath CLI' \
# -n 'Expant assets and find the binary for you'