-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Build additional RPM and arm64-deb; restructure & clean
- Loading branch information
Showing
3 changed files
with
219 additions
and
93 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
name: Build OpenOCD | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
init: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Version | ||
id: version | ||
run: | | ||
export VERSION_TMP="$(date +'%Y%m%d.%H%M')" | ||
echo "::set-env name=VERSION::$VERSION_TMP" | ||
echo $VERSION | ||
echo "::set-output name=VERSION::$VERSION_TMP" | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
release_name: Release ${{ env.VERSION }} | ||
draft: true | ||
prerelease: false | ||
outputs: | ||
version: ${{ steps.version.outputs.VERSION }} | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
|
||
build-deb: | ||
needs: init | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Version | ||
run: | | ||
echo "::set-env name=VERSION::${{ needs.init.outputs.version }}" | ||
echo $VERSION | ||
- name: Setup build environment | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install \ | ||
make libtool pkg-config autoconf automake \ | ||
texinfo tree libusb-dev libusb-1.0 \ | ||
libhidapi-dev libftdi-dev | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Clone OpenOCD repo | ||
run: | | ||
git clone http://openocd.zylin.com/openocd.git | ||
- name: "./bootstrap" | ||
run: | | ||
(cd openocd && ./bootstrap) | ||
- name: "./configure" | ||
run: | | ||
(cd openocd && ./configure --prefix=/opt/openocd \ | ||
--enable-ftdi --enable-stlink --enable-ti-icdi \ | ||
--enable-ulink --enable-usb-blaster-2 --enable-ft232r \ | ||
--enable-vsllink --enable-xds110 --enable-osbdm \ | ||
--enable-opendous --enable-aice --enable-usbprog \ | ||
--enable-rlink --enable-armjtagew --enable-cmsis-dap \ | ||
--enable-kitprog --enable-usb-blaster --enable-presto \ | ||
--enable-openjtag --enable-jlink) | ||
- name: Make | ||
run: (cd openocd && make -j8) | ||
- name: Make install | ||
run: (cd openocd && make install) | ||
- name: Debian package | ||
run: | | ||
sed -i s/VERSION/${{ env.VERSION }}/g deb-package/DEBIAN/control | ||
mkdir -p deb-package/opt/openocd | ||
cp -r /opt/openocd/* deb-package/opt/openocd/ | ||
sudo chown -R root:root deb-package/opt/openocd/ | ||
dpkg-deb --build deb-package | ||
- name: Test package installation | ||
run: sudo apt-get -y install ./deb-package.deb | ||
#- name: Debian package artifact | ||
# uses: actions/upload-artifact@v1 | ||
# with: | ||
# name: debian-package | ||
# path: deb-package.deb | ||
- name: Upload DEB Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.init.outputs.upload_url }} | ||
asset_path: ./deb-package.deb | ||
asset_name: openocd-master-${{ env.VERSION }}.amd64.deb | ||
asset_content_type: application/vnd.debian.binary-package | ||
|
||
build-rpm: | ||
needs: init | ||
runs-on: ubuntu-20.04 | ||
container: | ||
image: rleh/openocd-build-rpm-prerequisites:latest | ||
steps: | ||
- name: Version | ||
run: | | ||
echo "::set-env name=VERSION::${{ needs.init.outputs.version }}" | ||
echo $VERSION | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Prepare RPM build | ||
run: | | ||
mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/BUILD | ||
cp rpm-package/openocd.spec ~/rpmbuild/SPECS/openocd.spec | ||
sed -i s/VERSION/${{ env.VERSION }}/g ~/rpmbuild/SPECS/openocd.spec | ||
- name: Clone OpenOCD repo and run Bootstrap | ||
run: | | ||
(git clone http://openocd.zylin.com/openocd.git openocd-master && cd openocd-master/ && ./bootstrap) | ||
rm -rf openocd-master/.git/ | ||
zip -q -r ~/rpmbuild/SOURCES/openocd-master.zip openocd-master | ||
rm -rf openocd-master/ | ||
- name: Build RPM from spec file | ||
run: | | ||
cd ~/rpmbuild/SPECS | ||
rpmbuild -ba openocd.spec | ||
ls ~/rpmbuild/RPMS/x86_64/ | ||
export RPM_FILE_TMP="$(ls ~/rpmbuild/RPMS/x86_64/)" | ||
echo "::set-env name=RPM_FILE::$RPM_FILE_TMP" | ||
echo $RPM_FILE | ||
#- name: RPM package artifact | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: rpm-package | ||
# path: ~/rpmbuild/RPMS/x86_64/*.rpm | ||
- name: Upload RPM Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.init.outputs.upload_url }} | ||
asset_path: /github/home/rpmbuild/RPMS/x86_64/${{ env.RPM_FILE }} | ||
asset_name: ${{ env.RPM_FILE }} | ||
asset_content_type: application/x-rpm | ||
|
||
build-deb-arm64: | ||
needs: init | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Version | ||
run: | | ||
echo "::set-env name=VERSION::${{ needs.init.outputs.version }}" | ||
echo $VERSION | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Build on Arm64 | ||
uses: uraimo/run-on-arch-action@v2.0.5 | ||
id: runcmd | ||
with: | ||
arch: aarch64 | ||
distro: ubuntu20.04 | ||
githubToken: ${{ github.token }} | ||
run: | | ||
uname -a | ||
echo ::set-output name=uname::$(uname -a) | ||
apt-get update | ||
apt-get -y install make libtool pkg-config autoconf automake texinfo tree libusb-dev libusb-1.0 libhidapi-dev libftdi-dev git build-essential | ||
(git clone http://openocd.zylin.com/openocd.git && cd openocd && ./bootstrap) | ||
(cd openocd && ./configure --prefix=/opt/openocd \ | ||
--enable-ftdi --enable-stlink --enable-ti-icdi \ | ||
--enable-ulink --enable-usb-blaster-2 --enable-ft232r \ | ||
--enable-vsllink --enable-xds110 --enable-osbdm \ | ||
--enable-opendous --enable-aice --enable-usbprog \ | ||
--enable-rlink --enable-armjtagew --enable-cmsis-dap \ | ||
--enable-kitprog --enable-usb-blaster --enable-presto \ | ||
--enable-openjtag --enable-jlink) | ||
(cd openocd && make -j8) | ||
(cd openocd && make install) | ||
#cp openocd/contrib/60-openocd.rules /lib/udev/rules.d/60-openocd.rules | ||
sed -i s/VERSION/${{ env.VERSION }}/g deb-package/DEBIAN/control | ||
sed -i s/amd64/arm64/g deb-package/DEBIAN/control | ||
mkdir -p deb-package/opt/openocd | ||
cp -r /opt/openocd/* deb-package/opt/openocd/ | ||
chown -R root:root deb-package/opt/openocd/ | ||
#mkdir -p deb-package/lib/udev/rules.d | ||
#mkdir -p deb-package/usr/bin | ||
#mkdir -p deb-package/usr/share/doc/openocd | ||
#mkdir -p deb-package/usr/share/doc-base | ||
#mkdir -p deb-package/usr/share/info | ||
#mkdir -p deb-package/usr/share/lintian/overrides | ||
#mkdir -p deb-package/usr/share/man/man1 | ||
#mkdir -p deb-package/usr/share/metainfo | ||
#mkdir -p deb-package/usr/share/openocd | ||
#cp -r /lib/udev/rules.d/60-openocd.rules deb-package/lib/udev/rules.d/60-openocd.rules | ||
#cp -r /usr/bin/openocd deb-package/usr/bin/openocd | ||
#cp -r /usr/share/doc/openocd/* deb-package/usr/share/doc/openocd/ | ||
#cp -r /usr/share/doc-base/openocd deb-package/usr/share/doc-base/openocd | ||
#cp -r /usr/share/info/openocd.* deb-package/usr/share/info/ | ||
#cp -r /usr/share/lintian/overrides/openocd deb-package/usr/share/lintian/overrides/openocd | ||
#cp -r /usr/share/man/man1/openocd.1.gz deb-package/usr/share/man/man1/openocd.1.gz | ||
#cp -r /usr/share/metainfo/org.openocd.metainfo.xml deb-package/usr/share/metainfo/org.openocd.metainfo.xml | ||
#cp -r /usr/share/openocd/* deb-package/usr/share/openocd/ | ||
dpkg-deb --build deb-package | ||
apt-get -y install ./deb-package.deb | ||
- name: Debian package artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: debian-package-arm64 | ||
path: deb-package.deb | ||
- name: Upload DEB Arm64 Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.init.outputs.upload_url }} | ||
asset_path: ./deb-package.deb | ||
asset_name: openocd-master-${{ env.VERSION }}.arm64.deb | ||
asset_content_type: application/vnd.debian.binary-package |
This file was deleted.
Oops, something went wrong.
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