Skip to content

Restrict workflows to branches only #24

Restrict workflows to branches only

Restrict workflows to branches only #24

name: Create development releases

Check failure on line 1 in .github/workflows/create-dev-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-dev-release.yml

Invalid workflow file

you may only define one of `branches` and `branches-ignore` for a single event
on:
push:
branches:
- '**'
branches-ignore:
- master
- dependabot/*
jobs:
development:
if: github.event.ref_type == 'branch'
name: Create development release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup branch name variable
run: echo "GIT_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Configure apkovl file location
run: |
sed -i \
-E "s/^(set apkovl_release) \w+\$/\1 ${GIT_BRANCH_NAME}/" \
./default.pxe ./manual.pxe
- name: Create Alpine overlay file (apkovl)
run: |
chmod 0600 apkovl/etc/iptables/rules*
tar czf apkovl.tar.gz \
--owner=0 \
--group=0 \
-C apkovl .
- name: Create iSH overlay file (ishovl)
run: |
tar czf ishovl.tar.gz \
--owner=0 \
--group=0 \
-C ishovl .
- name: Create development release tag
run: |
git config user.name Github Actions
git config user.email [email protected]
git tag --force "${GIT_BRANCH_NAME}"
git push origin --tags --force
- name: Delete previous development release
run: |
gh release delete "${GIT_BRANCH_NAME}" --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Create new development release
run: |
gh release create "${GIT_BRANCH_NAME}" \
--generate-notes \
--latest=false \
--target "${GITHUB_REF}" \
--title "Dev: ${GIT_BRANCH_NAME}" \
*.pxe *.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}