Skip to content

Commit 0233a70

Browse files
committed
Fix release workflow
1 parent a4481a0 commit 0233a70

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

.github/workflows/publish.yml

+32-31
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,16 @@ jobs:
4646
- name: Process build output - Linux
4747
if: ${{ startsWith(matrix.arch_name, 'linux') }}
4848
working-directory: bin
49-
run: chmod +x ccomc
49+
run: |
50+
mv ./src/ccomc ccomc
51+
chmod +x ccomc
52+
53+
- name: Process build output - Windows
54+
if: ${{ startsWith(matrix.arch_name, 'windows') }}
55+
working-directory: bin
56+
run: |
57+
mv ./src/ccomc.exe ccomc.exe
58+
chmod +x ccomc.exe
5059
5160
- name: Upload artifact
5261
uses: actions/upload-artifact@v4
@@ -117,7 +126,7 @@ jobs:
117126
uses: goreleaser/goreleaser-action@v6
118127
with:
119128
version: v2.5.0
120-
args: release --rm-dist
129+
args: release --clean
121130
env:
122131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123132

@@ -157,7 +166,6 @@ jobs:
157166
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-buster/"
158167
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-stretch/"
159168
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-jessie/"
160-
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/debian-wheezy/"
161169
162170
- name: Deploy to Raspbian
163171
run: |
@@ -167,13 +175,11 @@ jobs:
167175
168176
- name: Deploy to Ubuntu repo
169177
run: |
170-
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-hirsute/"
171-
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-groovy/"
178+
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-noble/"
179+
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-jammy/"
172180
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-focal/"
173181
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-bionic/"
174182
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-xenial/"
175-
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-trusty/"
176-
curl -sSf -u "${{ secrets.NEXUS_USERNAME }}:${{ secrets.NEXUS_PASSWORD }}" -H "Content-Type: multipart/form-data" --data-binary "@./ccom_${{ matrix.arch }}.deb" "${{ secrets.NEXUS_URL }}/ubuntu-jammy/"
177183
178184
- name: Deploy to CentOS repo
179185
run: |
@@ -196,32 +202,31 @@ jobs:
196202
matrix:
197203
config:
198204
- {
199-
arch: amd64, label: x64
205+
arch: amd64,
206+
label: x64
200207
}
201208
- {
202-
arch: 386, label: x86
209+
arch: 386,
210+
label: x86
203211
}
204212
steps:
205213
- name: Checkout
206214
uses: actions/checkout@v4
207215

208-
- name: Get version name
209-
id: get_version
210-
uses: battila7/get-version-action@v2
216+
- name: Install GoMSI
217+
run: choco install -y go-msi
211218

212219
- name: Download executables
213220
id: download_exe
214221
shell: bash
215-
run: | # Remove the last command as soon as this is implemented: https://github.com/goreleaser/goreleaser/issues/1638
216-
hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_${{ matrix.config.arch }}*.zip'
222+
env:
223+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
224+
run: |
225+
gh release download "${GITHUB_REF#refs/tags/}" -p *windows_${{ matrix.config.arch }}*.zip
217226
printf "::set-output name=zip::%s\n" *.zip
218227
unzip -o *.zip && rm -v *.zip
219228
cp ./bin/ccomc-windows-${{ matrix.config.arch }}/ccomc.exe ./ccomc.exe
220-
env:
221-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
222-
223-
- name: Install GoMSI
224-
run: choco install -y go-msi
229+
dir
225230
226231
- name: Prepare PATH
227232
shell: bash
@@ -238,7 +243,7 @@ jobs:
238243
mkdir -p build
239244
msi="$(basename "$ZIP_FILE" ".zip").msi"
240245
printf "::set-output name=msi::%s\n" "$msi"
241-
go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version ${{ steps.get_version.outputs.version }}
246+
go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version ${{ github.ref_name }}
242247
printf "::set-output name=msi::%s\n" *.msi
243248
244249
- name: Upload MSI
@@ -249,16 +254,12 @@ jobs:
249254
asset_name: ccom_${{ matrix.config.label }}_setup.msi
250255
tag: ${{ github.ref }}
251256

252-
deploy-win-installers:
253-
name: Deploy installers
254-
if: startsWith(github.ref, 'refs/tags/')
255-
needs: build-win-installers
256-
runs-on: windows-latest
257-
258-
steps:
259-
- uses: vedantmgoyal2009/winget-releaser@v2
257+
- name: Deploy to WinGet
258+
uses: vedantmgoyal2009/winget-releaser@v2
259+
continue-on-error: true
260260
with:
261261
identifier: ChilliBits.CCom
262-
version: ${{ github.ref }}
263-
release-tag: ${{ github.ref }}
264-
token: ${{ secrets.CR_PAT }}
262+
version: ${{ github.ref_name }}
263+
release-tag: ${{ github.ref_name }}
264+
token: ${{ secrets.CR_PAT }}
265+
max-versions-to-keep: 10

0 commit comments

Comments
 (0)