Skip to content

Fix: Permission error on publish workflow #11

Fix: Permission error on publish workflow

Fix: Permission error on publish workflow #11

Workflow file for this run

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"