Skip to content

Use step outputs instead of setting env vars #7

Use step outputs instead of setting env vars

Use step outputs instead of setting env vars #7

Workflow file for this run

name: Release Creation
on:
push:
tags:
- "test-*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Load the system.json manifest into memory
- name: Load system manifest
id: manifest
uses: zoexx/github-action-json-file-properties@release
with:
file_path: "./public/system.json"
# Set up variables for future use
- name: Set up variables
id: vars
# Remove the 'v' from the tag for versioning
run: |
VERSION=${GITHUB_REF_NAME#v}
TAG_NAME=test-$VERSION
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
echo "zip_name=lancer-$TAG_NAME.zip" >> $GITHUB_OUTPUT
# Verify correct naming
- name: Verify correct naming
env:
PACKAGE_VERSION: ${{ steps.manifest.outputs.version }}
run: |
if [[ ! ${{ steps.vars.outputs.version }} == test-$PACKAGE_VERSION ]]; then
echo "The system.json version does not match tag name."
echo "system.json: $PACKAGE_VERSION"
echo "tag name: ${{ steps.vars.outputs.tag_name }}"
echo "Please fix this and push the tag again."
exit 1
fi
# Set up Node
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
# Install Dependencies
- name: Install Dependencies
run: npm ci
# Build the code and packs for distribution
- name: Build For Distribution
run: |
gulp build
gulp build_packs
# Package the built files
- name: Package Files
run: gulp package
# Create a release for this specific version
- name: Create Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ steps.vars.outputs.tag_name }}
draft: true
prerelease: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./public/system.json, ./${{ steps.vars.outputs.zip_name }}"
tag: ${{ steps.vars.outputs.tag_name }}
# TODO: can we automatically extract the changelog for this release?
body: |
**Installation:** To manually install this release, please use the following manifest URL: ${{ env.RELEASE_MANIFEST_URL }}