]> prime8.dev >> repos - ttyd.git/commitdiff
workflow: update actions
authorShuanglei Tao <tsl0922@gmail.com>
Tue, 18 Oct 2022 16:26:52 +0000 (00:26 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Tue, 18 Oct 2022 16:39:29 +0000 (00:39 +0800)
.github/workflows/backend.yml
.github/workflows/docker.yml
.github/workflows/frontend.yml
.github/workflows/release.yml

index 9dff62321c75a63972e9302e432ebd0884a58c60..4752c3e24102be75b1196cb033121eeedaf1de3a 100644 (file)
@@ -34,7 +34,7 @@ jobs:
           cd libwebsockets-${LWS_VERSION}
           cmake -DLWS_WITH_LIBUV=ON -DLWS_UNIX_SOCK=ON -DLWS_IPV6=ON -DLWS_WITHOUT_TESTAPPS=ON -DCMAKE_BUILD_TYPE=RELEASE .
           make && sudo make install && sudo ldconfig
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Build ttyd
         run: |
           cmake -DCMAKE_BUILD_TYPE=RELEASE .
@@ -46,7 +46,7 @@ jobs:
       matrix:
         target: [i686, x86_64, arm, armhf, aarch64, mips, mipsel, mips64, mips64el, s390x]
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Install packages
         run: |
           sudo apt-get update
@@ -55,14 +55,14 @@ jobs:
         env:
           BUILD_TARGET: ${{ matrix.target }}
         run: ./scripts/cross-build.sh
-      - uses: actions/upload-artifact@v2
+      - uses: actions/upload-artifact@v3
         with:
           name: ttyd.${{ matrix.target }}
           path: build/ttyd
   win10:
     runs-on: windows-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: msys2/setup-msys2@v2
         with:
           msystem: MINGW64
@@ -79,7 +79,7 @@ jobs:
       - name: Build ttyd
         shell: msys2 {0}
         run: ./scripts/mingw-build.sh
-      - uses: actions/upload-artifact@v2
+      - uses: actions/upload-artifact@v3
         with:
           name: ttyd.win10
           path: build/ttyd.exe
index de6ce6531ca7eea97f890fccac2a46e718e1aeea..4dbaf247f01eb00d980bbe1f7d409de7aec76d68 100644 (file)
@@ -9,7 +9,7 @@ jobs:
   build:
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Install packages
         run: |
           sudo apt-get update
@@ -22,9 +22,9 @@ jobs:
             [ "$arch" = "armv7" ] && arch="arm" 
             mkdir -p dist/$arch && cp build/ttyd dist/$arch/ttyd
           done
-      - uses: docker/setup-qemu-action@v1
-      - uses: docker/setup-buildx-action@v1
-      - uses: docker/login-action@v1
+      - uses: docker/setup-qemu-action@v2
+      - uses: docker/setup-buildx-action@v2
+      - uses: docker/login-action@v2
         with:
           username: ${{ secrets.DOCKER_HUB_USER }}
           password: ${{ secrets.DOCKER_HUB_TOKEN }}
@@ -34,26 +34,26 @@ jobs:
           case $GITHUB_REF in
             refs/tags/*)
               TAG_NAME=${GITHUB_REF#refs/tags/}
-              echo ::set-output name=DOCKER_TAG::tsl0922/ttyd:${TAG_NAME}
-              echo ::set-output name=ALPINE_TAG::tsl0922/ttyd:${TAG_NAME}-alpine
+              echo "DOCKER_TAG=tsl0922/ttyd:${TAG_NAME}" >> $GITHUB_ENV
+              echo "ALPINE_TAG=tsl0922/ttyd:${TAG_NAME}-alpine" >> $GITHUB_ENV
               ;;
             *)
-              echo ::set-output name=DOCKER_TAG::tsl0922/ttyd:latest
-              echo ::set-output name=ALPINE_TAG::tsl0922/ttyd:alpine
+              echo "DOCKER_TAG=tsl0922/ttyd:latest" >> $GITHUB_ENV
+              echo "ALPINE_TAG=tsl0922/ttyd:alpine" >> $GITHUB_ENV
           esac
       - name: build/push docker image
-        uses: docker/build-push-action@v2
+        uses: docker/build-push-action@v3
         with:
           context: .
           file: ./Dockerfile
           platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
           push: true
-          tags: ${{ steps.docker_tag.outputs.DOCKER_TAG }}
+          tags: ${{ env.DOCKER_TAG }}
       - name: build/push docker image (alpine)
-        uses: docker/build-push-action@v2
+        uses: docker/build-push-action@v3
         with:
           context: .
           file: ./Dockerfile.alpine
           platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/s390x
           push: true
-          tags: ${{ steps.docker_tag.outputs.ALPINE_TAG }}
+          tags: ${{ env.ALPINE_TAG }}
index 272a24b1b300172973deea1bf7489c035a684c33..f0005f107d419fcc783caba281e0778206cda006 100644 (file)
@@ -14,8 +14,8 @@ jobs:
   build:
     runs-on: ubuntu-20.04
     steps:
-      - uses: actions/checkout@v2
-      - uses: actions/setup-node@v1
+      - uses: actions/checkout@v3
+      - uses: actions/setup-node@v3
         with:
           node-version: '16.x'
       - name: Run yarn install, check and build
index a0ea6bfe2298541119308ba1b0119dec75991c5e..078b385cfc9d41f96300fcafcc1c580ef32ac32b 100644 (file)
@@ -6,30 +6,13 @@ on:
     - "*"
 
 jobs:
-  release:
-    runs-on: ubuntu-20.04
-    outputs:
-      upload_url: ${{ steps.create_release.outputs.upload_url }} 
-    steps:
-      - name: Create Release
-        id: create_release
-        uses: actions/create-release@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          tag_name: ${{ github.ref }}
-          release_name: ${{ github.ref }}
-          draft: true
-          prerelease: false
-
   build:
     runs-on: ubuntu-20.04
-    needs: release
     strategy:
       matrix:
         target: [i686, x86_64, arm, armhf, aarch64, mips, mipsel, mips64, mips64el, s390x]
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Install packages
         run: |
           sudo apt-get update
@@ -37,22 +20,18 @@ jobs:
       - name: Cross build (${{ matrix.target }})
         env:
           BUILD_TARGET: ${{ matrix.target }}
-        run: ./scripts/cross-build.sh
-      - name: Upload assets
-        id: upload-release-asset
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          ./scripts/cross-build.sh
+          mv build/ttyd build/ttyd.${{ matrix.target }}
+      - uses: ncipollo/release-action@v1
         with:
-          upload_url: ${{ needs.release.outputs.upload_url }}
-          asset_path: build/ttyd
-          asset_name: ttyd.${{ matrix.target }}
-          asset_content_type: application/octet-stream
+          artifacts: build/ttyd.${{ matrix.target }}
+          allowUpdates: true
+          draft: true
   win10:
     runs-on: windows-latest
-    needs: release
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - uses: msys2/setup-msys2@v2
         with:
           msystem: MINGW64
@@ -68,14 +47,11 @@ jobs:
           update: true
       - name: Build ttyd
         shell: msys2 {0}
-        run: ./scripts/mingw-build.sh
-      - name: Upload assets
-        id: upload-release-asset
-        uses: actions/upload-release-asset@v1
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          ./scripts/mingw-build.sh
+          mv build/ttyd.exe build/ttyd.win10.exe
+      - uses: ncipollo/release-action@v1
         with:
-          upload_url: ${{ needs.release.outputs.upload_url }}
-          asset_path: build/ttyd.exe
-          asset_name: ttyd.win10.exe
-          asset_content_type: application/octet-stream
+          artifacts: build/ttyd.win10.exe
+          allowUpdates: true
+          draft: true