Build & Release DaJet for Linux #6
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: Build & Release DaJet for Linux | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'DaJet version' | |
| required: true | |
| description: | |
| description: 'Release description' | |
| required: true | |
| env: | |
| DOTNET_TARGET: 'net8.0' | |
| jobs: | |
| publish: | |
| name: build-and-publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: src | |
| sparse-checkout-cone-mode: false | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| dotnet-quality: 'ga' | |
| - name: Install WASM Tools Workload | |
| run: dotnet workload install wasm-tools | |
| - name: Create output directories | |
| run: | | |
| mkdir ${{github.workspace}}/dajet-host | |
| mkdir ${{github.workspace}}/dajet-studio | |
| mkdir ${{github.workspace}}/dajet-studio/ui | |
| mkdir ${{github.workspace}}/dajet-studio/flow | |
| # DaJet Script Host | |
| - name: Publish DaJet Script Host | |
| working-directory: src/dajet | |
| run: dotnet publish -f ${{env.DOTNET_TARGET}} --os linux -a x64 -c Release -o ${{github.workspace}}/dajet-host | |
| - name: Prepare artifacts | |
| working-directory: dajet-host | |
| run: tar czvf "${{github.workspace}}/dajet-host-${{github.event.inputs.version}}-linux.tar.gz" "." | |
| - name: Create and upload release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: 'DaJet ${{github.event.inputs.version}}' | |
| tag_name: 'dajet-${{github.event.inputs.version}}' | |
| body: ${{github.event.inputs.description}} | |
| files: ${{github.workspace}}/dajet-host-${{github.event.inputs.version}}-linux.tar.gz | |
| draft: false | |
| prerelease: false | |
| make_latest: true | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| # DaJet Studio | |
| - name: Publish DaJet Studio | |
| working-directory: src/dajet-studio | |
| run: | | |
| dotnet publish -f ${{env.DOTNET_TARGET}} --os linux -a x64 -c Release -o ./bin | |
| cp -aT ./bin/wwwroot ${{github.workspace}}/dajet-studio/ui | |
| - name: Publish DaJet Flow Script | |
| working-directory: src/dajet-flow-script | |
| run: | | |
| dotnet publish -f ${{env.DOTNET_TARGET}} --os linux -a x64 -c Release -o ./bin | |
| cp ./bin/DaJet.Flow.Script* ${{github.workspace}}/dajet-studio/flow | |
| - name: Publish DaJet HTTP Server | |
| working-directory: src/dajet-http-server | |
| run: dotnet publish -f ${{env.DOTNET_TARGET}} --os linux -a x64 -c Release -o ${{github.workspace}}/dajet-studio | |
| - name: Prepare artifacts | |
| working-directory: dajet-studio | |
| run: tar czvf "${{github.workspace}}/dajet-studio-${{github.event.inputs.version}}-linux.tar.gz" "." | |
| - name: Upload artifacts | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: 'dajet-${{github.event.inputs.version}}' | |
| files: ${{github.workspace}}/dajet-studio-${{github.event.inputs.version}}-linux.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |