chore(deps): bump actions/attest-build-provenance from 1.4.4 to 2.1.0 #16
Workflow file for this run
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: Bump Version and Create Release | |
on: | |
pull_request: | |
types: [closed] | |
branches: [master, main] | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
security-events: write | |
jobs: | |
bump_version_and_create_release: | |
name: Bump version and create release | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'bump') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Determine Default bump type | |
id: determine_default_bump | |
run: | | |
labels=$(cat <<EOF | |
${{ toJson(github.event.pull_request.labels) }} | |
EOF | |
) | |
labels=$(echo "$labels" | jq -r '.[].name') | |
if echo "$labels" | grep -q "major"; then | |
echo "label_bump=major" >> $GITHUB_ENV | |
elif echo "$labels" | grep -q "minor"; then | |
echo "label_bump=minor" >> $GITHUB_ENV | |
else | |
echo "label_bump=patch" >> $GITHUB_ENV | |
fi | |
- name: Calculate bumped version | |
id: test_tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
default_bump: ${{ env.label_bump }} | |
dry_run: true | |
- name: Run version bump script | |
run: | | |
python3 Scripts/increment_version.py ${{ steps.test_tag_version.outputs.new_tag }} | |
- name: Attest Build Provenance | |
uses: actions/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
subject-name: "Flakkari Version Bump" | |
subject-path: "Scripts/increment_version.py" | |
- name: Set up Git and Push changes | |
env: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "chore: bump the Flakkari version to ${{ steps.test_tag_version.outputs.new_tag }}" || true | |
git push || true | |
- name: Create Tag | |
id: tag_version | |
env: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git tag ${{ steps.test_tag_version.outputs.new_tag }} | |
git push origin ${{ steps.test_tag_version.outputs.new_tag }} | |
- name: Create a GitHub release | |
uses: ncipollo/[email protected] | |
with: | |
tag: ${{ steps.test_tag_version.outputs.new_tag }} | |
name: Flakkari ${{ steps.test_tag_version.outputs.new_tag }} | |
body: ${{ steps.test_tag_version.outputs.changelog }} | |
generateReleaseNotes: true | |
build_package_artifacts: | |
name: Build package artifacts | |
needs: bump_version_and_create_release | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Flakkari Package | |
run: | | |
mkdir -p build | |
cd build | |
cmake .. | |
cmake --build . --config Release --target package | |
- name: Upload Flakkari Package | |
uses: actions/[email protected] | |
with: | |
name: Flakkari-${{ matrix.os }} | |
path: | | |
build/*.exe | |
build/*.dmg | |
build/*.deb | |
build/*.rpm |