mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-25 21:00:18 +00:00
parent
ee4bac9dc1
commit
d47f941fa0
1 changed files with 19 additions and 13 deletions
32
.github/workflows/build-and-release.yaml
vendored
32
.github/workflows/build-and-release.yaml
vendored
|
@ -5,6 +5,7 @@ on:
|
|||
branches: []
|
||||
tags:
|
||||
- 'v*'
|
||||
- "testing"
|
||||
paths:
|
||||
- 'src/**'
|
||||
- '.github/**'
|
||||
|
@ -38,9 +39,6 @@ jobs:
|
|||
id: build-bin
|
||||
run: |
|
||||
make all
|
||||
echo "::set-output name=file::./bin/spacebar"
|
||||
echo "::set-output name=name::spacebar"
|
||||
echo "::set-output name=sha::$(shasum -a 256 ./bin/spacebar | cut -d" " -f1)"
|
||||
|
||||
- name: Check execution & get version
|
||||
id: check-bin
|
||||
|
@ -57,28 +55,36 @@ jobs:
|
|||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- name: Check bin version before release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/testing') }}
|
||||
run: |
|
||||
[[ "$RELEASE_VERSION" == ${{ steps.check-bin.outputs.version }} ]]
|
||||
|
||||
- name: Create Release
|
||||
- name: Create release archive
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
id: archive
|
||||
run: |
|
||||
tar czvf spacebar-$RELEASE_VERSION.tar.gz bin/spacebar doc examples
|
||||
echo "::set-output name=file::spacebar-$RELEASE_VERSION.tar.gz"
|
||||
echo "::set-output name=sha::$(shasum -a 256 spacebar-$RELEASE_VERSION.tar.gz | cut -d" " -f1)"
|
||||
|
||||
- name: Create release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
id: create-release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
draft: false
|
||||
draft: ${{ startsWith(github.ref, 'refs/tags/testing') }}
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ env.RELEASE_VERSION }}
|
||||
body: |
|
||||
[Changelog](https://github.com/cmacrae/spacebar/blob/master/CHANGELOG.md)
|
||||
|
||||
You can find a precompiled binary in the release assets below.
|
||||
SHA-256 checksum:
|
||||
`${{ steps.build-bin.outputs.sha }}`
|
||||
You can find a precompiled release tarball in the release assets below.
|
||||
SHA-256 checksum:
|
||||
`${{ steps.archive.outputs.sha }}`
|
||||
|
||||
- name: Upload Release Asset
|
||||
- name: Upload release archive
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
|
@ -86,6 +92,6 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ${{ steps.build-bin.outputs.file }}
|
||||
asset_name: ${{ steps.build-bin.outputs.name }}
|
||||
asset_content_type: application/x-binary
|
||||
asset_path: ${{ steps.archive.outputs.file }}
|
||||
asset_name: ${{ steps.archive.outputs.file }}
|
||||
asset_content_type: application/gzip
|
||||
|
|
Loading…
Reference in a new issue