Update openharmony-build.yml #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenHarmony Build | |
| on: | |
| push: | |
| branches: | |
| - 'v**' | |
| pull_request: | |
| branches: | |
| - 'v**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Update Submodule | |
| run: | | |
| git submodule update --init --recursive | |
| - name: build for x64 | |
| working-directory: ${{ github.workspace }}/scripts | |
| run: | | |
| chmod +x ./build-openharmony-x64.sh | |
| ./build-openharmony-x64.sh | |
| - name: build for arm64 | |
| working-directory: ${{ github.workspace }}/scripts | |
| run: | | |
| chmod +x ./build-openharmony-arm64.sh | |
| ./build-openharmony-arm64.sh | |
| - name: pack nuget | |
| working-directory: ${{ github.workspace }}/package | |
| run: | | |
| nuget pack ./OpenHarmony.NET.Runtime.nuspec -OutputDirectory ../output -Version 0.0.0-alpha.${{github.run_number}} | |
| publish-to-nuget: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: packages | |
| path: output | |
| - uses: nuget/setup-nuget@v2 | |
| - name: Install Mono | |
| run: | | |
| sudo apt update & sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common -y | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
| sudo apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | |
| sudo apt install mono-complete | |
| mono --version | |
| - name: Push to NuGet | |
| run: | | |
| dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |