Skip to content

Commit 5b05f23

Browse files
committed
build: move cargo-deb to main release workflow
note: workarounds to test build need to be removed.
1 parent 598b5df commit 5b05f23

File tree

1 file changed

+115
-107
lines changed

1 file changed

+115
-107
lines changed

.github/workflows/release.yml

Lines changed: 115 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -112,119 +112,127 @@ jobs:
112112
rustembedded/cross:${{ matrix.target }} \
113113
aarch64-linux-gnu-strip \
114114
/target/${{ matrix.target }}/release/$BIN_NAME
115+
116+
- name: Build deb package (linux only)
117+
if: matrix.build == 'x86_64-linux'
118+
run: |
119+
cargo install cargo-deb
120+
cargo deb
121+
115122
- name: Build archive
116123
shell: bash
117124
run: |
125+
find target/
118126
mkdir dist
119127
if [ "${{ matrix.os }}" = "windows-2019" ]; then
120128
cp "target/${{ matrix.target }}/release/$BIN_NAME.exe" "dist/"
121129
else
122130
cp "target/${{ matrix.target }}/release/$BIN_NAME" "dist/"
123131
fi
124-
- uses: actions/[email protected]
125-
with:
126-
name: bins-${{ matrix.build }}
127-
path: dist
128-
129-
publish:
130-
name: Publish
131-
needs: [dist]
132-
if: contains(fromJson('["push", "schedule"]'), github.event_name) && startsWith(github.ref, 'refs/tags/')
133-
runs-on: ubuntu-latest
134-
steps:
135-
- name: Checkout sources
136-
uses: actions/checkout@v2
137-
with:
138-
submodules: false
139-
140-
- uses: actions/download-artifact@v2
141-
# with:
142-
# path: dist
143-
# - run: ls -al ./dist
144-
- run: ls -al bins-*
145-
146-
- name: Calculate tag name
147-
run: |
148-
name=dev
149-
if [[ $GITHUB_REF == refs/tags/v* ]]; then
150-
name=${GITHUB_REF:10}
151-
fi
152-
echo ::set-output name=val::$name
153-
echo TAG=$name >> $GITHUB_ENV
154-
id: tagname
155-
156-
- name: Build archive
157-
shell: bash
158-
run: |
159-
set -ex
160-
rm -rf tmp
161-
mkdir tmp
162-
mkdir dist
163-
for dir in bins-* ; do
164-
platform=${dir#"bins-"}
165-
unset exe
166-
if [[ $platform =~ "windows" ]]; then
167-
exe=".exe"
168-
fi
169-
pkgname=$PROJECT_NAME-$TAG-$platform
170-
mkdir tmp/$pkgname
171-
# cp LICENSE README.md tmp/$pkgname
172-
mv bins-$platform/$BIN_NAME$exe tmp/$pkgname
173-
chmod +x tmp/$pkgname/$BIN_NAME$exe
174-
if [ "$exe" = "" ]; then
175-
tar cJf dist/$pkgname.tar.xz -C tmp $pkgname
176-
else
177-
(cd tmp && 7z a -r ../dist/$pkgname.zip $pkgname)
178-
fi
179-
done
180-
- name: Upload binaries to release
181-
uses: svenstaro/upload-release-action@v2
182-
with:
183-
repo_token: ${{ secrets.GITHUB_TOKEN }}
184-
file: dist/*
185-
file_glob: true
186-
tag: ${{ steps.tagname.outputs.val }}
187-
overwrite: true
188-
189-
- name: Extract version
190-
id: extract-version
191-
run: |
192-
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
193-
- uses: mislav/bump-homebrew-formula-action@v1
194-
with:
195-
formula-path: ${{env.PROJECT_NAME}}.rb
196-
homebrew-tap: ${{ env.BREW_TAP }}
197-
download-url: 'https://github.com/${{ env.REPO_NAME }}/releases/download/${{ steps.extract-version.outputs.tag-name }}/${{env.PROJECT_NAME}}-${{ steps.extract-version.outputs.tag-name }}-x86_64-macos.tar.xz'
198-
commit-message: updating formula for ${{ env.PROJECT_NAME }}
199-
env:
200-
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
201-
#
202-
# you can use this initial file in your homebrew-tap if you don't have an initial formula:
203-
# <projectname>.rb
204-
#
205-
# class <Projectname capitalized> < Formula
206-
# desc "A test formula"
207-
# homepage "http://www.example.com"
208-
# url "-----"
209-
# version "-----"
210-
# sha256 "-----"
211-
212-
# def install
213-
# bin.install "<bin-name>"
214-
# end
215-
# end
216-
217-
# Uncomment this section if you want to release your package to crates.io
218-
# Before publishing, make sure you have filled out the following fields:
219-
# license or license-file, description, homepage, documentation, repository, readme.
220-
# Read more: https://doc.rust-lang.org/cargo/reference/publishing.html
221-
222-
- name: Install ${{ matrix.rust }} toolchain
223-
uses: actions-rs/toolchain@v1
224-
with:
225-
profile: minimal
226-
toolchain: ${{ matrix.rust }}
227-
target: ${{ matrix.target }}
228-
- run: cargo publish --token ${CRATES_TOKEN}
229-
env:
230-
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
132+
# - uses: actions/[email protected]
133+
# with:
134+
# name: bins-${{ matrix.build }}
135+
# path: dist
136+
137+
# publish:
138+
# name: Publish
139+
# needs: [dist]
140+
# if: contains(fromJson('["push", "schedule"]'), github.event_name) && startsWith(github.ref, 'refs/tags/')
141+
# runs-on: ubuntu-latest
142+
# steps:
143+
# - name: Checkout sources
144+
# uses: actions/checkout@v2
145+
# with:
146+
# submodules: false
147+
148+
# - uses: actions/download-artifact@v2
149+
# # with:
150+
# # path: dist
151+
# # - run: ls -al ./dist
152+
# - run: ls -al bins-*
153+
154+
# - name: Calculate tag name
155+
# run: |
156+
# name=dev
157+
# if [[ $GITHUB_REF == refs/tags/v* ]]; then
158+
# name=${GITHUB_REF:10}
159+
# fi
160+
# echo ::set-output name=val::$name
161+
# echo TAG=$name >> $GITHUB_ENV
162+
# id: tagname
163+
164+
# - name: Build archive
165+
# shell: bash
166+
# run: |
167+
# set -ex
168+
# rm -rf tmp
169+
# mkdir tmp
170+
# mkdir dist
171+
# for dir in bins-* ; do
172+
# platform=${dir#"bins-"}
173+
# unset exe
174+
# if [[ $platform =~ "windows" ]]; then
175+
# exe=".exe"
176+
# fi
177+
# pkgname=$PROJECT_NAME-$TAG-$platform
178+
# mkdir tmp/$pkgname
179+
# # cp LICENSE README.md tmp/$pkgname
180+
# mv bins-$platform/$BIN_NAME$exe tmp/$pkgname
181+
# chmod +x tmp/$pkgname/$BIN_NAME$exe
182+
# if [ "$exe" = "" ]; then
183+
# tar cJf dist/$pkgname.tar.xz -C tmp $pkgname
184+
# else
185+
# (cd tmp && 7z a -r ../dist/$pkgname.zip $pkgname)
186+
# fi
187+
# done
188+
# - name: Upload binaries to release
189+
# uses: svenstaro/upload-release-action@v2
190+
# with:
191+
# repo_token: ${{ secrets.GITHUB_TOKEN }}
192+
# file: dist/*
193+
# file_glob: true
194+
# tag: ${{ steps.tagname.outputs.val }}
195+
# overwrite: true
196+
197+
# - name: Extract version
198+
# id: extract-version
199+
# run: |
200+
# printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
201+
# - uses: mislav/bump-homebrew-formula-action@v1
202+
# with:
203+
# formula-path: ${{env.PROJECT_NAME}}.rb
204+
# homebrew-tap: ${{ env.BREW_TAP }}
205+
# download-url: 'https://github.com/${{ env.REPO_NAME }}/releases/download/${{ steps.extract-version.outputs.tag-name }}/${{env.PROJECT_NAME}}-${{ steps.extract-version.outputs.tag-name }}-x86_64-macos.tar.xz'
206+
# commit-message: updating formula for ${{ env.PROJECT_NAME }}
207+
# env:
208+
# COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
209+
# #
210+
# # you can use this initial file in your homebrew-tap if you don't have an initial formula:
211+
# # <projectname>.rb
212+
# #
213+
# # class <Projectname capitalized> < Formula
214+
# # desc "A test formula"
215+
# # homepage "http://www.example.com"
216+
# # url "-----"
217+
# # version "-----"
218+
# # sha256 "-----"
219+
220+
# # def install
221+
# # bin.install "<bin-name>"
222+
# # end
223+
# # end
224+
225+
# # Uncomment this section if you want to release your package to crates.io
226+
# # Before publishing, make sure you have filled out the following fields:
227+
# # license or license-file, description, homepage, documentation, repository, readme.
228+
# # Read more: https://doc.rust-lang.org/cargo/reference/publishing.html
229+
230+
# - name: Install ${{ matrix.rust }} toolchain
231+
# uses: actions-rs/toolchain@v1
232+
# with:
233+
# profile: minimal
234+
# toolchain: ${{ matrix.rust }}
235+
# target: ${{ matrix.target }}
236+
# - run: cargo publish --token ${CRATES_TOKEN}
237+
# env:
238+
# CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

0 commit comments

Comments
 (0)