mirror of
https://github.com/ekaaty/ca-certificates-brazil.git
synced 2025-12-06 01:22:38 -03:00
[CI/CD] Added GH Workflows
--------- Signed-off-by: Leonardo Amaral <contato@leonardoamaral.com.br> Co-authored-by: Leonardo Amaral <contato@leonardoamaral.com.br> [CI/CD] Added GH Workflows
This commit is contained in:
committed by
Christian Tosta
parent
3df218f8e7
commit
0683dbbed8
58
.github/workflows/ci.yml
vendored
Normal file
58
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Build and Release CI
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '30 3 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release-ci:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.get_metadata.outputs.version }}
|
||||
tag: ${{ steps.get_metadata.outputs.tag }}
|
||||
to_release: ${{ steps.newtag.outputs.to_release }}
|
||||
|
||||
steps:
|
||||
- name: Local checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install CI dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y -qq install cmake g++ gcc
|
||||
|
||||
- name: Get latest package metadata
|
||||
id: get_metadata
|
||||
run: |
|
||||
cmake --fresh -B build -S .
|
||||
echo "tag=v$(cat build/version)" >> $GITHUB_OUTPUT
|
||||
echo "version=$(cat build/version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if package version has corresponding git tag
|
||||
id: tagged
|
||||
shell: bash
|
||||
run: |
|
||||
git show-ref \
|
||||
--tags --verify --quiet -- \
|
||||
"refs/tags/${{ steps.get_metadata.outputs.tag }}" \
|
||||
&& echo tagged=1 >> $GITHUB_OUTPUT \
|
||||
|| echo tagged=0 >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create new tag and set to_release
|
||||
id: newtag
|
||||
if: steps.tagged.outputs.tagged == 0
|
||||
run: |
|
||||
git tag ${{ steps.get_metadata.outputs.tag }} \
|
||||
&& echo to_release=1 >> $GITHUB_OUTPUT \
|
||||
&& git push origin ${{ steps.get_metadata.outputs.tag }} \
|
||||
|| exit 0
|
||||
|
||||
build-fedora:
|
||||
needs: release-ci
|
||||
uses: ./.github/workflows/fedora.yml
|
||||
with:
|
||||
containers: "['fedora:latest', 'fedora:41']"
|
||||
version: ${{ needs.release-ci.outputs.version }}
|
||||
to_release: ${{ needs.release-ci.outputs.to_release }}
|
||||
tag: ${{ needs.release-ci.outputs.tag }}
|
||||
Reference in New Issue
Block a user