Skip to content

Commit

Permalink
create a release with artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ozcodes committed Nov 18, 2024
1 parent 6e81e4d commit 27611ed
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: Build Tools
on:
push:
branches:
- oz/ci # TODO: change this
- oz/ci # TODO: remove this
- main
tags: ['*']
workflow_dispatch:

jobs:
build-mac:
Expand Down Expand Up @@ -56,3 +59,26 @@ jobs:
with:
name: platform-tools-linux-x86_64.tar.bz2
path: out/platform-tools-linux-x86_64.tar.bz2

release:
runs-on: ubuntu-latest
needs: [build-linux, build-mac]
if: startsWith(github.event.ref, 'refs/tags/') # only on new tag creation
env:
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
- name: Create a release
env:
GH_TOKEN: ${{ github.token }}
run: |
release_exist=$(gh release view $TAG 2>&1 || exit 0)
if [ "$release_exist" = "release not found" ]; then
gh release create $TAG platform-tools-osx-aarch64.tar.bz2/platform-tools-osx-aarch64.tar.bz2 --title "Release $TAG" --generate-notes --latest
gh release upload $TAG platform-tools-linux-x86_64.tar.bz2/platform-tools-linux-x86_64.tar.bz2
else
gh release upload $TAG platform-tools-osx-aarch64.tar.bz2/platform-tools-osx-aarch64.tar.bz2
gh release upload $TAG platform-tools-linux-x86_64.tar.bz2/platform-tools-linux-x86_64.tar.bz2
fi

0 comments on commit 27611ed

Please sign in to comment.