Skip to content

Create source package for release #20

Create source package for release

Create source package for release #20

Workflow file for this run

name: Create source package for release
# Needing this, because wlmaker uses submodules, and github source package
# creation will not include submodules -- and cannot be tuned for that.
# See: https://github.com/phkaeser/wlmaker/issues/133
on:
push:
branches:
- package-release
- main
tags:
- v*
release:
types:
- published
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code, including required submodules.
uses: actions/checkout@v3
with:
# Not using 'recursive' prevents fetching extra submodules below
# dependencies/. These are only needed to build wlroots from source.
submodules: true
- name: Setup environment.
run: |
echo "We have ${GITHUB_REF}"
echo "And ${GITHUB_REF#refs/tags/}"
tag_or_branch="${GITHUB_REF#refs/tags/}"
tag_or_branch="${tag_or_branch#refs/heads/}"
echo "WLM_RELEASE_NAME=wlmaker-$(echo $tag_or_branch | sed "s/^v//")" >> "$GITHUB_ENV"
echo "WLM_RELEASE_FILE=wlmaker-$(echo $tag_or_branch | sed "s/^v//").tar.gz" >> "$GITHUB_ENV"
- name: Create source package.
run: |
# Setup folder with package name, for apprropriate unpacking.
rm -rf "/tmp/${WLM_RELEASE_NAME}"
cp -a "${PWD}" "/tmp/${WLM_RELEASE_NAME}"
mv "/tmp/${WLM_RELEASE_NAME}" .
tar -zcvf "${WLM_RELEASE_FILE}" "${WLM_RELEASE_NAME}"
echo "Created source archive ${WLM_RELEASE_FILE}."
- name: Upload source package.
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{env.WLM_RELEASE_FILE}}