@@ -27,15 +27,18 @@ jobs:
2727 - target : x86_64-unknown-linux-gnu
2828 runner : ubuntu-latest
2929 asset_name : dstimer-linux-x86_64
30+ use_upx : true
3031
3132 - target : aarch64-unknown-linux-gnu
3233 runner : ubuntu-latest
3334 asset_name : dstimer-linux-aarch64
3435 use_cross : true
36+ use_upx : true
3537
3638 - target : x86_64-pc-windows-msvc
3739 runner : windows-latest
3840 asset_name : dstimer-windows-x86_64.exe
41+ use_upx : true
3942
4043 steps :
4144 - uses : actions/checkout@v4
6164 if : matrix.use_cross != true
6265 run : cargo build --release --target ${{ matrix.target }}
6366
67+ - name : Compress binary with UPX (Linux)
68+ if : matrix.use_upx == true && matrix.runner == 'ubuntu-latest'
69+ run : |
70+ sudo apt-get install -y upx-ucl
71+ upx --best --lzma target/${{ matrix.target }}/release/dstimer
72+
73+ - name : Compress binary with UPX (Windows)
74+ if : matrix.use_upx == true && matrix.runner == 'windows-latest'
75+ run : |
76+ choco install upx -y
77+ upx --best --lzma target/${{ matrix.target }}/release/dstimer.exe
78+
6479 - name : Rename binary (Unix)
6580 if : matrix.runner != 'windows-latest'
6681 run : cp target/${{ matrix.target }}/release/dstimer ${{ matrix.asset_name }}
@@ -90,3 +105,49 @@ jobs:
90105 with :
91106 files : artifacts/*
92107 generate_release_notes : true
108+
109+ # TODO: Enable after first manual submission to microsoft/winget-pkgs is accepted
110+ # publish-winget:
111+ # name: Publish to WinGet
112+ # needs: release
113+ # runs-on: windows-latest
114+ # steps:
115+ # - name: Submit to WinGet
116+ # uses: vedantmgoyal9/winget-releaser@v2
117+ # with:
118+ # identifier: madLinux7.dstimer
119+ # installers-regex: 'dstimer-windows-x86_64\.exe$'
120+ # token: ${{ secrets.WINGET_TOKEN }}
121+
122+ # TODO: Enable when ready for Scoop distribution
123+ # update-scoop:
124+ # name: Update Scoop manifest
125+ # needs: release
126+ # runs-on: ubuntu-latest
127+ # steps:
128+ # - uses: actions/checkout@v4
129+ #
130+ # - name: Download Windows artifact
131+ # uses: actions/download-artifact@v4
132+ # with:
133+ # name: dstimer-windows-x86_64.exe
134+ # path: artifacts
135+ #
136+ # - name: Update Scoop manifest
137+ # run: |
138+ # VERSION="${GITHUB_REF_NAME#v}"
139+ # SHA256=$(sha256sum artifacts/dstimer-windows-x86_64.exe | cut -d' ' -f1)
140+ # cd pkg/scoop
141+ # jq --arg v "$VERSION" --arg h "$SHA256" \
142+ # '.version = $v |
143+ # .architecture."64bit".url = "https://github.com/madLinux7/dead-simple-cli-timer/releases/download/v\($v)/dstimer-windows-x86_64.exe#/dstimer.exe" |
144+ # .architecture."64bit".hash = $h' \
145+ # dstimer.json > dstimer.json.tmp && mv dstimer.json.tmp dstimer.json
146+ #
147+ # - name: Commit updated manifest
148+ # run: |
149+ # git config user.name "github-actions[bot]"
150+ # git config user.email "github-actions[bot]@users.noreply.github.com"
151+ # git add pkg/scoop/dstimer.json
152+ # git diff --cached --quiet || git commit -m "chore: update Scoop manifest to ${GITHUB_REF_NAME}"
153+ # git push
0 commit comments