diff --git a/.github/actions/upload-artifact/action.yml b/.github/actions/upload-artifact/action.yml index 277ce58d..7bc9f5d9 100644 --- a/.github/actions/upload-artifact/action.yml +++ b/.github/actions/upload-artifact/action.yml @@ -31,17 +31,21 @@ runs: client = Client( "http://mc.yuhao7370.top:5212/dav", - auth=("${{ inputs.WEBDAV_USERNAME }}", "${{ inputs.WEBDAV_PASSWORD }}") + auth=("${{ inputs.WEBDAV_USERNAME }}", "${{ inputs.WEBDAV_PASSWORD }}"), + timeout=None, ) if '${{ inputs.ARTIFACT_TYPE }}' == 'release': + print('Removing previous ${{ inputs.ARTIFACT_PLATFORM }} release file...') for file in client.ls('Techmino distribution'): if re.search(r'(Techmino_a[0-9]+\.[0-9]+\.[0-9]_${{ inputs.ARTIFACT_PLATFORM }}.*)', file['name']): client.remove(file['name']) + print('Uploading new ${{ inputs.ARTIFACT_PLATFORM }} release file...') client.upload_file("${{ inputs.ARTIFACT_NAME }}", 'Techmino distribution/${{ inputs.ARTIFACT_NAME }}') if '${{ inputs.ARTIFACT_TYPE }}' == 'test': + print('Removing previous ${{ inputs.ARTIFACT_PLATFORM }} test file...') for file in client.ls('Techmino Snapshot'): if re.search(r'(Techmino_pre[0-9]+\.[0-9]+\.[0-9]_[0-9a-z]{7}_${{ inputs.ARTIFACT_PLATFORM }}.*)', file['name']): client.remove(file['name']) + print('Uploading new ${{ inputs.ARTIFACT_PLATFORM }} test file...') client.upload_file("${{ inputs.ARTIFACT_NAME }}", 'Techmino Snapshot/${{ inputs.ARTIFACT_NAME }}') - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffc454f0..487e885f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,17 +51,17 @@ jobs: path: love - name: Pack Techmino run: 7z a -tzip .\Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows.zip .\love - # - name: Upload artifact to server - # uses: ./.github/actions/upload-artifact - # with: - # WEBDAV_USERNAME: ${{ secrets.WEBDAV_USERNAME }} - # WEBDAV_PASSWORD: ${{ secrets.WEBDAV_PASSWORD }} - # ARTIFACT_TYPE: test - # ARTIFACT_PLATFORM: Windows - # ARTIFACT_NAME: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows.zip - name: Upload artifact to server - run: | - curl --user "${{ secrets.WEBDAV_USERNAME }}:${{ secrets.WEBDAV_PASSWORD }}" -T Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows.zip http://mc.yuhao7370.top:5212/dav/Techmino%20Snapshots/ -v + uses: ./.github/actions/upload-artifact + with: + WEBDAV_USERNAME: ${{ secrets.WEBDAV_USERNAME }} + WEBDAV_PASSWORD: ${{ secrets.WEBDAV_PASSWORD }} + ARTIFACT_TYPE: test + ARTIFACT_PLATFORM: Windows + ARTIFACT_NAME: Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows.zip + # - name: Upload artifact to server + # run: | + # curl --user "${{ secrets.WEBDAV_USERNAME }}:${{ secrets.WEBDAV_PASSWORD }}" -T Techmino_pre${{ needs.get-info.outputs.release }}_${{ needs.get-info.outputs.commit }}_Windows.zip http://mc.yuhao7370.top:5212/dav/Techmino%20Snapshots/ -v build-linux: runs-on: ubuntu-20.04