Skip to content

Commit

Permalink
Github action to create prereleases from tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
lumip committed Mar 18, 2022
1 parent 3377fae commit 5ac004c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2021 Lukas <lumip> Prediger
# Copyright 2022 Lukas <lumip> Prediger

name: Build Binaries

on:
workflow_call:
workflow_dispatch:
push:
branches: [ "master" ]
pull_request:
branches: [ "*stable", ]
tags: [ "*rc*" ]
branches: [ "*stable" ]

jobs:
build-binaries:
Expand All @@ -26,7 +28,7 @@ jobs:
- name: Upload GUI binaries.
uses: actions/upload-artifact@v3
with:
name: gui-binaries
name: fsmodm-gui
path: |
MSFSModManager.GUI/bin/Release/net5.0/win-x64/publish/*.exe
MSFSModManager.GUI/bin/Release/net5.0/win-x64/publish/*.dll
Expand All @@ -38,7 +40,7 @@ jobs:
- name: Upload CLI binaries.
uses: actions/upload-artifact@v3
with:
name: cli-binaries
name: fsmodm-cli
path: |
MSFSModManager.CLI/bin/Release/netcoreapp3.1/win-x64/publish/*.exe
MSFSModManager.CLI/bin/Release/netcoreapp3.1/win-x64/publish/*.dll
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright 2022 Lukas <lumip> Prediger

name: Create Pre-Release

on:
push:
tags: [ '*' ]

jobs:
build-binaries:
uses: ./.github/workflows/build_binaries.yml

create-release:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- build-binaries
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: binaries
- name: Bundle ZIPs
run: |
cd binaries
zip -r fsmodm-cli.zip fsmodm-cli
zip -r fsmodm-gui.zip fsmodm-gui
- name: Publish Pre-Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=${GITHUB_REF##refs/tags/}
echo "Version: ${VERSION}"
echo "Ref: ${GITHUB_REF}"
echo "Tag: ${TAG_NAME}"
assets=()
for asset in $(find wheels -type f); do
echo "Adding asset: ${asset}"
assets+=("-a" "$asset")
done
hub release create -p -a binaries/fsmodm-cli.zip -a binaries/fsmodm-gui.zip -m "$TAG_NAME" "$TAG_NAME"

0 comments on commit 5ac004c

Please sign in to comment.