Thanks to visit codestin.com
Credit goes to github.com

Skip to content
88 changes: 88 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
version: 2.1
jobs:
make:
docker:
- image: pixey/ipxe-build

parameters:
# iPXE Configuration can be defined as variables here
binary_name:
type: string

steps:
- checkout

- run:
name: Disable PIE
command: sed -i 's/^CFLAGS.*/CFLAGS := -fno-pie/g' ./src/Makefile

- run:
name: Make binary
command: "cd ./src && make << parameters.binary_name >>"

- persist_to_workspace:
root: "./src/"
paths:
- "<< parameters.binary_name >>"

github_release:
docker:
- image: circleci/golang:1.8

steps:
- attach_workspace:
at: ./src/

- run:
name: Create artifacts directory
command: mkdir ./artifacts

- run:
name: Flatten artifacts
command: mv ./src/bin-x86_64-pcbios/* ./artifacts && mv ./src/bin-x86_64-efi/* ./artifacts

- run:
name: Dump
command: find .

- run:
name: "Publish Release on GitHub"

command: |
go get github.com/tcnksm/ghr
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./artifacts/

workflows:
build_and_deploy:
jobs:
- make:
name: make_x86_64_efi
binary_name: bin-x86_64-efi/ipxe.efi
filters:
tags:
only: /.*/

- make:
name: make_x86_64_bios_undinoly_kpxe
binary_name: bin-x86_64-pcbios/undionly.kpxe
filters:
tags:
only: /.*/

- make:
name: make_x86_64_bios_undinoly_kkpxe
binary_name: bin-x86_64-pcbios/undionly.kkpxe
filters:
tags:
only: /.*/

- github_release:
requires:
- make_x86_64_efi
- make_x86_64_bios_undinoly_kpxe
- make_x86_64_bios_undinoly_kkpxe
filters: # Release only tags
branches:
ignore: /.*/
tags:
only: /^pixey\-.*$/