Publish source #388
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
# This workflow takes care of building and publishing the source code of the Danish Public Libraries CMS. | |
name: Publish source | |
on: | |
create | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
# Validate the format of the tag. We only want to react on a precise pattern. | |
- name: Detect release tag | |
id: detect_tag | |
run: | | |
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]] | |
then | |
echo ::set-output name=IS_RELEASE_TAG::true | |
else | |
echo ::set-output name=IS_RELEASE_TAG::false | |
fi | |
# Extract version from tag. | |
- name: Get version | |
id: get_version | |
run: | | |
echo ::set-output name=RELEASE_TAG::$(echo ${GITHUB_REF#refs/tags/} | cut -d '_' -f 2) | |
if: ${{ steps.detect_tag.outputs.IS_RELEASE_TAG == 'true' }} | |
# Install go-task since we need it for building the source package. | |
- name: Install go-task | |
uses: arduino/setup-task@v1 | |
if: ${{ steps.detect_tag.outputs.IS_RELEASE_TAG == 'true' }} | |
- name: Build and publish source | |
run: task source:deploy | |
if: ${{ steps.detect_tag.outputs.IS_RELEASE_TAG == 'true' }} | |
env: | |
CR_PAT: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_TAG: ${{ steps.get_version.outputs.RELEASE_TAG }} |