Skip to content

Commit

Permalink
Test the CI/CD builds again.
Browse files Browse the repository at this point in the history
  • Loading branch information
paveloom committed Apr 2, 2023
1 parent d792ea9 commit 5915a8a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/scripts/delete_release.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# A script to delete a GitHub release if it exists

# Get the release ID
RELEASE_ID=$(
curl \
-s \
-H "Accept: application/vnd.github+json" \
"${GH_REPO}"/releases/tags/"${TAG}" \
2>/dev/null | jq '.id'
)

if [ "${RELEASE_ID}" != "null" ]; then
# Delete the release
curl \
-su paveloom:"${GH_TOKEN}" \
-X DELETE \
-H "Accept: application/vnd.github+json" \
"${GH_REPO}/releases/${RELEASE_ID}"
# Delete the tag
curl \
-su paveloom:"${GH_TOKEN}" \
-X DELETE \
-H "Accept: application/vnd.github+json" \
"${GH_REPO}/git/refs/tags/${TAG}"
fi
37 changes: 37 additions & 0 deletions .github/workflows/Build & Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build & Release
on:
workflow_dispatch:
jobs:
build:
name: Build & Release
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
options: --privileged
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install the dependencies
run: dnf -y install jq
- name: Bundle the application
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: Tracy.flatpak
manifest-path: manifest.yml
verbose: true
- name: Delete the previous release (if exists)
run: .github/scripts/delete_release.bash
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
GH_REPO: https://api.github.com/repos/paveloom-a/Tracy
TAG: latest
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: Latest
body: The latest build of the [Tracy Profiler](https://github.com/wolfpld/tracy) as a [single-file bundle](https://docs.flatpak.org/en/latest/single-file-bundles.html).
tag_name: latest
files: |
Tracy.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5915a8a

Please sign in to comment.