name: LoongArch64
'on':
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@v3

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3.4.0
        with:
          image: loongarch64/debian
          platforms: loong64
      - name: setup
        run: |
          apt update
          apt install nodejs dotnet-sdk-8.0 zip
      - name: publish 
        run: ./publish-loongarch64.sh  
      - name: Get latest release
        id: get_release
        run: |
          response=$(curl -s \
            -H "Accept: application/vnd.github+json" \
            -H "Authorization: Bearer ${{ secrets.ACTIONS_TOKEN }}" \
            "https://api.github.com/repos/${{ github.repository }}/releases/latest")
          upload_url=$(echo "$response" | jq -r '.upload_url')
          echo "upload_url=$upload_url" >> $GITHUB_OUTPUT