name: Publich
'on':
  push:
    branches:
      - master
jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
      - name: setup node.js
        uses: actions/setup-node@v2
        with:
          node-version: '16'
      - name: setup dotnet8
        uses: actions/setup-dotnet@v2
        env:
          GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
        with:
          dotnet-version: 8.0.x
      - name: setup msbuild
        uses: microsoft/setup-msbuild@v2
        with:
          msbuild-architecture: x64
      - name: install dotnet maui
        run: dotnet workload install maui

      - name: get current date
        id: date
        run: echo "::set-output name=today::$(date +'%Y-%m-%d')"
      - name: create release
        id: create_release
        uses: GongT/actions-recreate-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
        with:
          tag_name: v1.0.0
          release_name: v1.0.0.${{ steps.date.outputs.today }}
          draft: false
          prerelease: false
          body: ""
      - name: publish projects
        run: ./publish.bat "C:\\Android\\android-sdk"