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 .
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
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
- 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
build:
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Install packages
run: |
sudo apt-get update
[ "$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 }}
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 }}
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
- "*"
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
- 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
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