Skip to content

update dependencies

update dependencies #7

Workflow file for this run

# https://github.com/nightcycle/occlusion-camera/blob/main/.github/workflows/release.yml
name: Release package
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'version.txt'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
submodules: recursive
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Get version
id: version
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const core = require('@actions/core')
const fs = require('fs');
const version = fs.readFileSync('${{ github.workspace }}/version.txt', 'utf8')
core.setOutput('version', version);
console.log(version)
- name: Update files with new version
id: update-files
shell: bash
run: |
# read wally.toml file
wally_toml_contents=$(<wally.toml)
# swap out name
target_name_line=$(echo "$wally_toml_contents" | grep -F "name = ")
goal_name_line="name = \"${{github.repository}}\""
wally_toml_contents="${wally_toml_contents/${target_name_line}/${goal_name_line}}"
# swap out version
target_version_line=$(echo "$wally_toml_contents" | grep -F "version = ")
goal_version_line="version = \"${{ steps.version.outputs.version }}\""
wally_toml_contents="${wally_toml_contents/${target_version_line}/${goal_version_line}}"
# update wally.toml file
echo "$wally_toml_contents" > wally.toml
# read package.json file
default_json_contents=$(<package.json)
target_json_version_line=$(echo "$default_json_contents" | grep -F "\"version\": ")
goal_json_version_line=" \"version\": \"${{ steps.version.outputs.version }}\","
default_json_contents="${default_json_contents/${target_json_version_line}/${goal_json_version_line}}"
# update package.json file
echo "$default_json_contents" > package.json
# read README.md file
readme_contents=$(<README.md)
target_readme_version_line=$(echo "$readme_contents" | grep -F "${{ github.event.repository.name }} = \"")
goal_readme_version_line="${{ github.event.repository.name }} = \"${{github.repository}}@${{ steps.version.outputs.version }}\""
readme_contents="${readme_contents/${target_readme_version_line}/${goal_readme_version_line}}"
# update README.md file
echo "$readme_contents" > README.md
- name: Commit files with new version
id: commit-files
run: |
# Commit version update
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add --all
git commit -m "Update to v${{ steps.version.outputs.version }}"
git push -u origin main --force-with-lease || true
COMMIT_SHA=$(git rev-parse HEAD)
echo "Committed changes"
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
# Create GitHub release
- name: Create ${{ steps.version.outputs.version }} Runner Release
uses: actions/create-release@master
id: createRelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.version.outputs.version }}"
release_name: "v${{ steps.version.outputs.version }}"
commitish: ${{ steps.commit-files.outputs.commit_sha }}
- name: Install aftman dependencies
uses: ok-nick/[email protected]
- name: Install dependencies
run: npm run build:dependencies
- name: Publish to wally
shell: bash
env:
WALLY_TOKEN: ${{ secrets.WALLY_TOKEN }}
run: |
rm -rf packages testez.toml .github node_modules .vscode
mkdir -p ~/.wally
printf "[tokens]\n\"https://api.wally.run/\" = \"%s\"" "$WALLY_TOKEN" >> ~/.wally/auth.toml
wally publish
- name: Build package place file
run: rojo build -o ${{ github.event.repository.name }}.rbxl build.project.json
- name: Upload Roblox level file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.createRelease.outputs.upload_url }}
asset_path: ${{ github.event.repository.name }}.rbxl
asset_name: ${{ github.event.repository.name }}.rbxl
asset_content_type: application/octet-stream