Build cloudflared Compress with UPX #338
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build cloudflared Compress with UPX | |
on: | |
workflow_dispatch: | |
#push: | |
# branches: | |
# - main | |
schedule: | |
- cron: 0 16 * * * | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Compress with UPX | |
run: | | |
# install upx | |
wget https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-amd64_linux.tar.xz | |
tar -Jxf upx*.tar.xz | |
sudo cp upx*/upx /usr/bin | |
# download cloudflared | |
mkdir -p musldist | |
cd musldist | |
wget -qO cloudflared-linux-amd64 https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 | |
wget -qO cloudflared-linux-arm64 https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64 | |
chmod +x cloudflared-linux-amd64 | |
chmod +x cloudflared-linux-arm64 | |
cp cloudflared-linux-amd64 cloudflared-linux-amd64-source | |
cp cloudflared-linux-arm64 cloudflared-linux-arm64-source | |
# do upx Compress | |
upx -1 cloudflared-linux-amd64 | |
upx -1 cloudflared-linux-arm64 | |
- name: Upload dist | |
uses: actions/upload-artifact@main | |
with: | |
name: cloudflared | |
path: | | |
musldist | |
- name: Generate release tag | |
id: tag | |
run: echo "::set-output name=release_tag::cloudflared" | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: | | |
musldist/* | |
- name: Remove old Releases | |
uses: dev-drprasad/[email protected] | |
if: env.UPLOAD_RELEASE == 'true' && !cancelled() | |
with: | |
keep_latest: 1 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_KEY }} |