From b26db0d51c256f7e52172a830ee918f4d62787ef Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 28 Jun 2022 21:56:23 +0100 Subject: [PATCH] add nightly release --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4cc95f3..96caaffd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,22 +41,34 @@ jobs: shell: pwsh run: | Compress-Archive ./target/release-lto/lapce.exe ./Lapce-windows-portable.zip + + - if: github.event_name == 'workflow_dispatch' + run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV + - if: github.event_name == 'schedule' + run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV + - if: github.event_name == 'push' + run: | + TAG_NAME=${{ github.ref }} + echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV + - name: Upload msi installer uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./Lapce-windows.msi file_glob: true - tag: ${{ github.ref }} + tag: ${{ env.TAG_NAME }} overwrite: true + prerelease: ${{ env.TAG_NAME == 'nightly' }} - name: Upload portable uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./Lapce-windows-portable.zip file_glob: true - tag: ${{ github.ref }} + tag: ${{ env.TAG_NAME }} overwrite: true + prerelease: ${{ env.TAG_NAME == 'nightly' }} linux: runs-on: ubuntu-18.04 @@ -76,22 +88,34 @@ jobs: cp ./target/release-lto/lapce Lapce/ tar -zcvf ./Lapce-linux.tar.gz Lapce gzip -c "./target/release-lto/lapce-proxy" > ./lapce-proxy-linux.gz + + - if: github.event_name == 'workflow_dispatch' + run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV + - if: github.event_name == 'schedule' + run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV + - if: github.event_name == 'push' + run: | + TAG_NAME=${{ github.ref }} + echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV + - name: Upload Application uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./Lapce-linux.tar.gz file_glob: true - tag: ${{ github.ref }} + tag: ${{ env.TAG_NAME }} overwrite: true + prerelease: ${{ env.TAG_NAME == 'nightly' }} - name: Upload Application uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./lapce-proxy-linux.gz file_glob: true - tag: ${{ github.ref }} + tag: ${{ env.TAG_NAME }} overwrite: true + prerelease: ${{ env.TAG_NAME == 'nightly' }} macos: runs-on: macos-11 @@ -121,11 +145,22 @@ jobs: uses: devbotsxyz/xcode-staple@v1 with: product-path: "./target/release-lto/macos/Lapce-macos.dmg" + + - if: github.event_name == 'workflow_dispatch' + run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV + - if: github.event_name == 'schedule' + run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV + - if: github.event_name == 'push' + run: | + TAG_NAME=${{ github.ref }} + echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV + - name: Upload Application uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./target/release-lto/macos/Lapce-macos.dmg file_glob: true - tag: ${{ github.ref }} + tag: ${{ env.TAG_NAME }} overwrite: true + prerelease: ${{ env.TAG_NAME == 'nightly' }}