Add: Basic files of sample source code repository #1
Workflow file for this run
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
sample-pack: | |
name: Pack sample sources | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Compress sample project's sources | |
run: | | |
mkdir release-sample | |
zip -r Samples.zip Samples | |
mv Samples.zip release-sample | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Samples | |
path: "release-sample" | |
publish: | |
name: Publish | |
needs: [sample-pack] | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Fetch Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
- name: Install hub command | |
run: | | |
sudo apt update | |
sudo apt install -y hub | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_ACTIONS }} | |
run: | | |
set -x | |
assets=() | |
for asset in dist/Samples/*.zip; do | |
assets+=("-a" "$asset") | |
done | |
tag_name="${GITHUB_REF##*/}" | |
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" |