Skip to content

Commit

Permalink
Merge pull request #145 from hackerspace-ntnu/dev
Browse files Browse the repository at this point in the history
NGA release
  • Loading branch information
Fueredoriku committed Apr 12, 2023
2 parents e584c52 + 593b3a8 commit 9539d66
Show file tree
Hide file tree
Showing 203 changed files with 37,164 additions and 2,565 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
target-branch: "dev"
commit-message:
prefix: "👷"
include: "scope"
161 changes: 161 additions & 0 deletions .github/workflows/_reusable_add-content-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# This is a reusable workflow; see https://docs.github.com/en/actions/using-workflows/reusing-workflows.
# It was created because GitHub projects' workflows (see e.g. https://github.com/orgs/hackerspace-ntnu/projects/1/workflows)
# don't (currently) support doing the specific things done in the steps below.
#
# The workflow requires that the following repository variables have been created:
# - `ORGANIZATION_PROJECT_NUMBER` - The number/ID in the project URL (https://github.com/orgs/hackerspace-ntnu/projects/1)
# - `ORGANIZATION_PROJECT__STATUS_VALUE_FOR_CLOSED_ITEMS` - The value of the 'Status' field set for an item when closed
# (see https://github.com/orgs/hackerspace-ntnu/projects/1/workflows/3836538)
# and the following organization variables:
# - `ORGANIZATION_NAME` - The name of the organization in the project URL (https://github.com/orgs/hackerspace-ntnu/projects/1)
#
# The workflow also expects that the following project workflows are turned on for the project:
# - "Item closed" (https://github.com/orgs/hackerspace-ntnu/projects/1/workflows/3836538):
# - "When an item is closed": "issue, pull request"
# - "Set value": "Status: <the value of the `ORGANIZATION_PROJECT__STATUS_VALUE_FOR_CLOSED_ITEMS` repository variable>"
# and that the following project workflows are turned off:
# - "Item added to project"
# - "Item reopened"
# (The "Pull request merged" project workflow (https://github.com/orgs/hackerspace-ntnu/projects/1/workflows/3836539)
# does not affect and is not affected by any of this.
# However, it could be natural that it sets the same value as the "Item closed" project workflow.)

name: Add content to project

on:
workflow_call:
inputs:
content_id:
description: "The ID of an issue or a PR, to be added to this repo's GitHub project"
required: true
type: string
status_field_value_name:
description: "The name of one of the values of the project's (single select) 'Status' field, to set for the added project item"
required: true
type: string

jobs:
add_content:
runs-on: ubuntu-latest
# Code based on https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions#example-workflow-authenticating-with-a-github-app
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
with:
app_id: ${{ secrets.HACKERSPACE_BOT_APP_ID }}
private_key: ${{ secrets.HACKERSPACE_BOT_APP_PEM }}

- name: Get project data
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ORGANIZATION: ${{ vars.ORGANIZATION_NAME }}
PROJECT_NUMBER: ${{ vars.ORGANIZATION_PROJECT_NUMBER }}
# This name is hardcoded by GitHub and cannot be changed
STATUS_FIELD_NAME: Status
STATUS_FIELD_VALUE_NAME: ${{ inputs.status_field_value_name }}
run: |
gh api graphql -f query='
query ($org: String!, $number: Int!) {
organization(login: $org) {
projectV2(number: $number) {
id
fields(first: 20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org="$ORGANIZATION" -F number="$PROJECT_NUMBER" > project_data.json
{
# The ID of this repo's GitHub project
echo "PROJECT_ID=$(jq -r '.data.organization.projectV2.id' project_data.json)"
# The ID of the project's status field
echo "STATUS_FIELD_ID=$(jq --arg FIELD_NAME "$STATUS_FIELD_NAME" -r '.data.organization.projectV2.fields.nodes[] | select(.name==$FIELD_NAME) | .id' project_data.json)"
# The ID of one of the values of the project's (single select) status field, with name `inputs.status_field_value_name`
echo "STATUS_FIELD_VALUE_ID=$(jq --arg FIELD_NAME "$STATUS_FIELD_NAME" --arg STATUS_NAME "$STATUS_FIELD_VALUE_NAME" -r '.data.organization.projectV2.fields.nodes[] | select(.name==$FIELD_NAME) | .options[] | select(.name==$STATUS_NAME) | .id' project_data.json)"
} >> "$GITHUB_ENV"
- name: Add content to project
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
CONTENT_ID: ${{ inputs.content_id }}
run: |
item_id="$( gh api graphql -f query='
mutation ($project: ID!, $content: ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $content}) {
item {
id
}
}
}' -f project="$PROJECT_ID" -f content="$CONTENT_ID" --jq '.data.addProjectV2ItemById.item.id' )"
# The ID of the project item (representing an issue or a PR with ID `inputs.content_id`), which was either added or already existed
echo "ITEM_ID=$item_id" >> "$GITHUB_ENV"
- name: Get project item data
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
gh api graphql -f query='
query ($itemId: ID!) {
node(id: $itemId) {
... on ProjectV2Item {
fieldValues(first: 20) {
nodes {
... on ProjectV2ItemFieldSingleSelectValue {
name
field {
... on ProjectV2SingleSelectField {
id
}
}
}
}
}
}
}
}' -f itemId="$ITEM_ID" > project_item_data.json
{
# The value of the project item's status field (with ID `env.STATUS_FIELD_ID`)
echo "STATUS_FIELD_VALUE=$(jq --arg FIELD_ID "$STATUS_FIELD_ID" -r '.data.node.fieldValues.nodes[] | select(.field.id==$FIELD_ID) | .name' project_item_data.json)"
} >> "$GITHUB_ENV"
- name: Set status
# Only set the status if it's not already set,
# or if it's a reopened issue/PR (as they should be marked with the value of `ORGANIZATION_PROJECT__STATUS_VALUE_FOR_CLOSED_ITEMS` when closed
# - see https://github.com/orgs/hackerspace-ntnu/projects/1/workflows/3836538)
if: ${{ !env.STATUS_FIELD_VALUE
|| github.event.action == 'reopened' && env.STATUS_FIELD_VALUE == vars.ORGANIZATION_PROJECT__STATUS_VALUE_FOR_CLOSED_ITEMS }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
gh api graphql -f query='
mutation ($project: ID!, $item: ID!, $status_field: ID!, $status_value: String!) {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: {
singleSelectOptionId: $status_value
}
}) {
projectV2Item {
id
}
}
}' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f status_field="$STATUS_FIELD_ID" -f status_value="$STATUS_FIELD_VALUE_ID" --silent
94 changes: 94 additions & 0 deletions .github/workflows/label-release-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# This workflow makes a naive attempt at enforcing a convention that
# PRs should generally always and only be labeled with the release label if it merges the development branch into the production branch.
#
# The workflow requires that the following repository variables have been created:
# - `REPOSITORY_NAME` - The name of the repository
# - `PRODUCTION_BRANCH_NAME` - The name of the repository's production branch (e.g. `main`)
# - `DEVELOPMENT_BRANCH_NAME` - The name of the repository's development branch (e.g. `dev`)
# - `RELEASE_LABEL_NAME` - The name of the release label used in the repository (e.g. `new release`)
# and the following organization variables:
# - `ORGANIZATION_NAME` - The name of the organization in the project URL (https://github.com/orgs/hackerspace-ntnu/projects/1)

name: Label release pull requests

on:
pull_request:
# `edited` will trigger if the PR changes its base branch
types: [ opened, edited ]

jobs:
manage_release_label_of_pull_request:
# Do a rough check - which will weed out most PRs - before doing more detailed checks in the steps below
if: ${{ github.base_ref == vars.PRODUCTION_BRANCH_NAME && github.head_ref == vars.DEVELOPMENT_BRANCH_NAME
|| contains(github.event.pull_request.labels.*.name, vars.RELEASE_LABEL_NAME) }}
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0
with:
app_id: ${{ secrets.HACKERSPACE_BOT_APP_ID }}
private_key: ${{ secrets.HACKERSPACE_BOT_APP_PEM }}

- name: Get label data
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ORGANIZATION: ${{ vars.ORGANIZATION_NAME }}
REPOSITORY_NAME: ${{ vars.REPOSITORY_NAME }}
RELEASE_LABEL_NAME: ${{ vars.RELEASE_LABEL_NAME }}
run: |
gh api graphql -f query='
query ($org: String!, $repoName: String!) {
organization(login: $org) {
repository(name: $repoName) {
labels(first: 100) {
nodes {
id
name
}
}
}
}
}' -f org="$ORGANIZATION" -f repoName="$REPOSITORY_NAME" > repo_data.json
# The ID of this repository's release label
echo "LABEL_ID=$(jq --arg LABEL_NAME "$RELEASE_LABEL_NAME" -r '.data.organization.repository.labels.nodes[] | select(.name==$LABEL_NAME) | .id' repo_data.json)" >> "$GITHUB_ENV"
- name: Label release pull request
# Add the release label if the PR merges the development branch into the production branch,
# and it doesn't already have the release label
if: ${{ github.base_ref == vars.PRODUCTION_BRANCH_NAME && github.head_ref == vars.DEVELOPMENT_BRANCH_NAME
&& !contains(github.event.pull_request.labels.*.name, vars.RELEASE_LABEL_NAME) }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
CONTENT_ID: ${{ github.event.pull_request.node_id }}
run: |
gh api graphql -f query='
mutation ($content: ID!, $label: ID!) {
addLabelsToLabelable(input: {labelableId: $content, labelIds: [$label]}) {
labelable {
labels {
totalCount
}
}
}
}' -f content="$CONTENT_ID" -f label="$LABEL_ID" --silent
- name: Remove label from non-release pull request
# Remove the release label if the PR is not for merging the development branch into the production branch
if: ${{ (github.base_ref != vars.PRODUCTION_BRANCH_NAME || github.head_ref != vars.DEVELOPMENT_BRANCH_NAME)
&& contains(github.event.pull_request.labels.*.name, vars.RELEASE_LABEL_NAME) }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
CONTENT_ID: ${{ github.event.pull_request.node_id }}
run: |
gh api graphql -f query='
mutation ($content: ID!, $label: ID!) {
removeLabelsFromLabelable(input: {labelableId: $content, labelIds: [$label]}) {
labelable {
labels {
totalCount
}
}
}
}' -f content="$CONTENT_ID" -f label="$LABEL_ID" --silent
17 changes: 17 additions & 0 deletions .github/workflows/project-add-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This workflow requires that the following repository variables have been created:
# - `ORGANIZATION_PROJECT__STATUS_VALUE_FOR_ADDED_ISSUES` - The value of the 'Status' field to set for issues when added to the project.
# in addition to the ones required by `_reusable_add-content-to-project.yml`.

name: Add issues to project

on:
issues:
types: [ opened, reopened ]

jobs:
add_to_project:
uses: ./.github/workflows/_reusable_add-content-to-project.yml
with:
content_id: ${{ github.event.issue.node_id }}
status_field_value_name: ${{ vars.ORGANIZATION_PROJECT__STATUS_VALUE_FOR_ADDED_ISSUES }}
secrets: inherit
19 changes: 19 additions & 0 deletions .github/workflows/project-add-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This workflow requires that the following repository variables have been created:
# - `ORGANIZATION_PROJECT__STATUS_VALUE_FOR_ADDED_PULL_REQUESTS` - The value of the 'Status' field to set for pull requests when added to the project.
# in addition to the ones required by `_reusable_add-content-to-project.yml`.

name: Add pull requests to project

on:
pull_request:
types: [ opened, reopened, ready_for_review ]

jobs:
add_to_project:
# Don't run the job if it's a draft PR
if: ${{ !github.event.pull_request.draft }}
uses: ./.github/workflows/_reusable_add-content-to-project.yml
with:
content_id: ${{ github.event.pull_request.node_id }}
status_field_value_name: ${{ vars.ORGANIZATION_PROJECT__STATUS_VALUE_FOR_ADDED_PULL_REQUESTS }}
secrets: inherit
7 changes: 0 additions & 7 deletions Assets/Animation/Augments/Armature.001_ShootAndReset.anim
Original file line number Diff line number Diff line change
Expand Up @@ -5346,13 +5346,6 @@ AnimationClip:
floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.7083333
functionName: OnFire
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0
- time: 0.7083333
functionName: ToggleBullet
data:
Expand Down
12 changes: 12 additions & 0 deletions Assets/Audio/AudioMixer.mixer
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ AudioMixerController:
m_EnableSuspend: 1
m_UpdateMode: 0
m_ExposedParameters:
- guid: 91868c90a0f70ec9abb83d3a5cc5e620
name: Layer 0
- guid: 741ab6f222a1326058fa8d9232afaf72
name: Layer 1
- guid: da00e3f18803a6192b26fe60ba2364e0
name: Layer 2
- guid: a9e393cfdb76c404b8e988c2a57389b3
name: Layer 3
- guid: 3b2079f6d0f8ce24ca56c55b7203fbca
name: Layer 4
- guid: c7ed491c11c71b87592b3b376b85397a
name: Layer 5
- guid: 8ffc2a85299b20642ba3c3856c7de698
name: masterVolume
- guid: be5cfe27030a85440a9040af06d17650
Expand Down
7 changes: 6 additions & 1 deletion Assets/Audio/Music/Battle.asset
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
title: Pump-Action Trumpet
composer: Tore Bergebakken
enabledLayers: 0100
layers:
- {fileID: 8300000, guid: 1a2e39630dd18169ba0bea7102b3a29d, type: 3}
- {fileID: 8300000, guid: 250b1276e0d9661e7ba4e1454325a2a6, type: 3}
- {fileID: 8300000, guid: aa53d067cca0bda11b063997f08ec539, type: 3}
loopLayers:
- {fileID: 8300000, guid: be8ebe36f4809a127b58cb312580f997, type: 3}
- {fileID: 8300000, guid: f43cbe8c346e2200c9036ee5df368b08, type: 3}
Binary file added Assets/Audio/Music/BattleLoopBase.ogg
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Audio/Music/BattleLoopStrings.ogg
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Audio/Music/BattleLoopStrings.ogg.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Audio/Music/BattleStartBase.ogg
Binary file not shown.
Loading

0 comments on commit 9539d66

Please sign in to comment.