From: Shuanglei Tao Date: Tue, 18 Oct 2022 16:26:52 +0000 (+0800) Subject: workflow: update actions X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=f72b383a80a384d46e9d522eab34ac5794f2d5a2;p=ttyd.git workflow: update actions --- diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 9dff623..4752c3e 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index de6ce65..4dbaf24 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 }} diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 272a24b..f0005f1 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0ea6bf..078b385 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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