Version 0.0.6 #24
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
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] | |
environment: Release Preprocessor | |
permissions: | |
contents: write | |
outputs: | |
commit-hash: ${{ steps.commit-and-push.outputs.commit_hash }} | |
steps: | |
- uses: actions/[email protected] | |
id: release-preprocessor-bot-token | |
with: | |
app-id: ${{ vars.RELEASE_PREPROCESSOR_APP_ID }} | |
private-key: ${{ secrets.RELEASE_PREPROCESSOR_PRIVATE_KEY }} | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
token: ${{ steps.release-preprocessor-bot-token.outputs.token }} | |
- name: Restore installed items | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.rokit | |
~/.lune | |
Packages | |
DevPackages | |
key: tools-${{ hashFiles('rokit.toml') }} | |
- name: Add rokit tools to PATH | |
run: echo "$HOME/.rokit/bin" >> $GITHUB_PATH | |
- name: Locally update version & copyright year in files | |
run: lune run preprocessRelease ${{ needs.get-version.outputs.version-with-dots }} | |
- name: Commit version & copyright year updates | |
id: commit-and-push | |
uses: stefanzweifel/[email protected] | |
with: | |
commit_message: "Preprocess release for version ${{ needs.get-version.outputs.version-with-dots }}" | |
branch: main | |
file_pattern: "README.md wally.toml src/StateQ/init.luau LICENSE.md" | |
create-release-artifacts: | |
name: Create release artifacts | |
runs-on: ubuntu-latest | |
needs: [install-tools, get-version, preprocess-release] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
ref: ${{ needs.preprocess-release.outputs.commit-hash }} | |
- name: Restore installed items | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.rokit | |
~/.lune | |
Packages | |
DevPackages | |
key: tools-${{ hashFiles('rokit.toml') }} | |
- name: Add rokit tools to PATH | |
run: echo "$HOME/.rokit/bin" >> $GITHUB_PATH | |
- name: Build release artifacts | |
run: lune run build ${{ needs.get-version.outputs.version-with-dashes }} | |
- name: Cache artifacts | |
uses: actions/[email protected] | |
with: | |
path: | | |
build | |
wally.toml | |
key: artifacts-${{ needs.get-version.outputs.tag-name }} | |
publish-wally-artifact: | |
name: Publish release artifact to Wally | |
runs-on: ubuntu-latest | |
needs: | |
[install-tools, get-version, preprocess-release, create-release-artifacts] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
ref: ${{ needs.preprocess-release.outputs.commit-hash }} | |
- name: Restore installed items | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.rokit | |
~/.lune | |
Packages | |
DevPackages | |
key: tools-${{ hashFiles('rokit.toml') }} | |
- name: Restore build artifacts | |
uses: actions/[email protected] | |
with: | |
path: | | |
build | |
wally.toml | |
key: artifacts-${{ needs.get-version.outputs.tag-name }} | |
- name: Add rokit tools to PATH | |
run: echo "$HOME/.rokit/bin" >> $GITHUB_PATH | |
- name: Log in to Wally | |
run: wally login --token ${{ secrets.WALLY_ACCESS_TOKEN }} | |
- name: Publish package to Wally | |
run: wally publish | |
upload-github-artifacts: | |
name: Upload artifacts to the GitHub release | |
runs-on: ubuntu-latest | |
needs: [get-version, create-release-artifacts] | |
permissions: | |
contents: write | |
steps: | |
- name: Restore build artifacts | |
uses: actions/[email protected] | |
with: | |
path: | | |
build | |
wally.toml | |
key: artifacts-${{ needs.get-version.outputs.tag-name }} | |
- name: Print files | |
run: ls -R | |
- name: Upload zip artifact to the GitHub release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: build/zip/StateQ-${{ needs.get-version.outputs.version-with-dashes}}.zip | |
asset_name: StateQ-${{ needs.get-version.outputs.version-with-dashes}}.zip | |
asset_content_type: application/zip | |
- name: Upload rbxm artifact to the GitHub release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: build/rbxm/StateQ-${{ needs.get-version.outputs.version-with-dashes }}.rbxm | |
asset_name: StateQ-${{ needs.get-version.outputs.version-with-dashes }}.rbxm | |
asset_content_type: application/octet-stream |