Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Add GH Action to upload asset
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Jul 9, 2020
1 parent 9e6295a commit 21cce59
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Upload Release Asset

on:
push:
tags:
- "v*"

jobs:
main:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build project
run: |
./gradlew :projector-server:distZip
cd projector-server/build/distributions
find . -maxdepth 1 -type f -name projector-server-*.zip -exec mv {} projector-server.zip \;
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Tag name # Inspired from https://github.community/t/how-to-get-just-the-tag-name/16241/11
id: tag_name
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: projector-server/build/distributions/projector-server.zip
asset_name: projector-server-${{ steps.tag_name.outputs.SOURCE_TAG }}.zip
asset_content_type: application/zip

0 comments on commit 21cce59

Please sign in to comment.