actions: add ft_lemipc to deloyment #1
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
name: CD | ||
run-name: ft_libft CD deployment | ||
on: | ||
workflow_call: | ||
jobs: | ||
git_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ☁️ Retrieve repo | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: 🔧 Declare some var | ||
run: |+ | ||
{ | ||
echo "sha7=${GITHUB_SHA::7}" | ||
printf "ver=%s" \ | ||
"$(perl -nE 'print if s|^VERSION_LIBFT\s+:= (\d\.\d\.\d)|\1|gm' ./mk/config.mk)" | ||
} >> ${GITHUB_ENV} | ||
- name: 🔧 Build up libft.a and pack release | ||
run: |+ | ||
DISABLE_HELPER=1 make re | ||
DISABLE_HELPER=1 make clean | ||
rm -rf ./.git && cd .. | ||
tar czf ft_libft-${{ env.ver }}-${{ env.sha7 }}.tar.gz ft_libft | ||
- name: ☁️ Upload release artifact | ||
if: success() | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
fail_on_unmatched_files: true | ||
draft: false | ||
prerelease: false | ||
name: build ${{ env.sha7 }} | ||
tag_name: v${{ env.ver }}-${{ env.sha7 }} | ||
files: ../ft_libft-${{ env.ver }}-${{ env.sha7 }}.tar.gz | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
update_other: | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
repo: [ | ||
"Pixailz/SupaBlank", | ||
"Pixailz/ft_ping", | ||
"Pixailz/ft_traceroute" | ||
"Pixailz/ft_lemipc" | ||
] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ☁️ Retrieve ${{ matrix.repo }} repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ matrix.repo }} | ||
submodules: recursive | ||
token: ${{ secrets.PAT_ACTIONS }} | ||
- name: ☁️ Update submodules | ||
run: |+ | ||
git submodule update --remote --recursive | ||
- name: 🔧 test ${{ matrix.repo }} | ||
run: make | ||
- name: ☁️ Configure, commit and push | ||
run: |+ | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add . || true | ||
git commit -m "[ft_libft] submodule update spread" || true | ||
git status && git push || true |