Skip to content

Release

Release #7

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
get-version:
name: Get version from release tag
runs-on: ubuntu-latest
outputs:
tag-name: ${{ steps.output-version.outputs.tag_name }}
version-with-dots: ${{ steps.output-version.outputs.version_with_dots }}
version-with-dashes: ${{ steps.output-version.outputs.version_with_dashes }}
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Output version and tag name
id: output-version
run: |
# Get the tag name (e.g., v0.1.0)
tag_name="${{ github.event.release.tag_name }}"
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
echo "tag_name=$tag_name"
# Strip the leading 'v' to get the version (e.g., 0.1.0)
version_with_dots="${tag_name#v}"
echo "version_with_dots=$version_with_dots" >> $GITHUB_OUTPUT
echo "version_with_dots=$version_with_dots"
# Replaces . with - for use in filenames (e.g., 0-1-0)
version_with_dashes="${version_with_dots//./-}"
echo "version_with_dashes=$version_with_dashes" >> $GITHUB_OUTPUT
echo "version_with_dashes=$version_with_dashes"
install-tools:
name: Install tools and dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Rokit
uses: CompeyDev/[email protected]
- name: Setup Lune
run: lune setup
- name: Install dependencies with Wally
run: wally install
- name: Cache installed items
uses: actions/[email protected]
with:
path: |
~/.rokit
~/.lune
Packages
DevPackages
key: tools-${{ hashFiles('rokit.toml') }}
preprocess-release:
name: Preprocess release (update versions, copyright years)
runs-on: ubuntu-latest
needs: [install-tools, get-version]
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Restore installed items
uses: actions/[email protected]
with:
path: |
~/.rokit
~/.lune
Packages
DevPackages
key: tools-${{ hashFiles('rokit.toml') }}
- name: Locally update version & copyright year in files
run: ~/.rokit/bin/lune run preprocessRelease ${{ needs.get-version.outputs.version-with-dots }}
- name: Commit version & copyright year updates
uses: stefanzweifel/[email protected]
with:
commit_message: "Preprocess release for version ${{ needs.get-version.outputs.version-with-dots }}"
branch: release-action # TODO: Switch to main once this is tested
file_pattern: "README.md wally.toml src/StateQ/init.luau LICENSE.md"
create-release:
name: Create release
runs-on: ubuntu-latest
needs: [install-tools, get-version, preprocess-release]
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Restore installed items
uses: actions/[email protected]
with:
path: |
~/.rokit
~/.lune
Packages
DevPackages
key: tools-${{ hashFiles('rokit.toml') }}
- name: Build release targets
run: ~/.rokit/bin/lune run build ${{ needs.get-version.outputs.version-with-dashes }}
- name: Login to wally
run: wally login --token ${{ secrets.WALLY_ACCESS_TOKEN }}
# - name: Publish package to wally
# run: wally publish --output build/wally/StateQ