diff --git a/.gitea/workflows/build-windows.yaml b/.gitea/workflows/build-windows.yaml index 1834249..4f72cfc 100644 --- a/.gitea/workflows/build-windows.yaml +++ b/.gitea/workflows/build-windows.yaml @@ -10,53 +10,56 @@ env: OUT_DIR: ./output jobs: + release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Create Release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + with: + tag_name: ${{ gitea.ref }} + release_name: ${{ gitea.ref }} + draft: false + prerelease: false publish: name: publish - # needs: - # - release + needs: + - release strategy: fail-fast: true matrix: include: - - target: windows-2022 - suffix: windows-x86_64 + - suffix: windows-x86_64 platform: windows-2022 archive: zip name: x86_64-pc-windows-msvc - - target: x86_64-unknown-linux-gnu - suffix: linux-x86_64 + - suffix: linux-x86_64 platform: ubuntu-latest archive: tar.gz name: x86_64-unknown-linux-gnu runs-on: ${{ matrix.platform }} steps: - - name: Dump git[hub|ea] context + - name: Ensure rust is up to date run: | - echo "$env:GITHUB_CONTEXT" - echo "$env:GITEA_CONTEXT" - echo "$GITHUB_CONTEXT" - echo "$GITEA_CONTEXT" - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - GITEA_CONTEXT: ${{ toJson(gitea) }} - - # - name: Ensure rust is up to date - # run: | - # rustup update - # rustup toolchain install nightly - # - uses: actions/checkout@v4 - # - name: Create output directory - # run: mkdir -f output - # - name: Build release - # run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output - # - name: Collect windows artifacts - # if: matrix.platform != 'windows-2022' - # shell: powershell - # run: | - # cp -r -fo assets $env:GITHUB_WORKSPACE/$env:OUT_DIR/ - # Compress-Archive -Path $env:GITHUB_WORKSPACE/$env:OUT_DIR/* -DestinationPath $env:GITHUB_WORKSPACE/mosquitoswatter_${{ matrix.name }}.${{ matrix.archive }} - # - name: Upload artifacts - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifacts: "mosquitoswatter_${{ matrix.name }}.${{ matrix.archive }}" + rustup update + rustup toolchain install nightly + - uses: actions/checkout@v4 + - name: Create output directory + run: mkdir -f output + - name: Build release + run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output + - name: Collect windows artifacts + if: matrix.platform != 'windows-2022' + shell: powershell + run: | + cp -r -fo assets $env:GITEA_WORKSPACE/$env:OUT_DIR/ + Compress-Archive -Path $env:GITEA_WORKSPACE/$env:OUT_DIR/* -DestinationPath $env:GITEA_WORKSPACE/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }} + - name: Upload artifacts + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: "${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }}"