-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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
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 }} |