Skip to content

Commit

Permalink
Merge pull request #2802 from decentraland/release/release-15-11-2024
Browse files Browse the repository at this point in the history
release: 15-11-2024
  • Loading branch information
m3taphysics authored Nov 18, 2024
2 parents bf90c01 + 3d7e3d3 commit 46a6a9a
Show file tree
Hide file tree
Showing 237 changed files with 8,619 additions and 391 deletions.
51 changes: 36 additions & 15 deletions .github/actions/version/action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
name: 'Version'
description: 'Parse, update and format the given tag for onward operations'
description: 'Parse, update, and format the given tag for onward operations'
inputs:
tag:
description: 'Formated version tag. If not set it uses latest version tag (v[0-9]*)'
description: 'Formatted version tag. If not set, it uses the latest version tag (v[0-9]*)'
required: false
outputs:
latest_version:
description: 'Latest available version tag in repo'
value: ${{ steps.get_latest_version_tag.outputs.tag }}
full_version:
description: 'v1.2.3-name-branch'
description: 'v1.2.3-name-branch-shortsha'
value: ${{ steps.parser.outputs.full_version }}
short_version:
description: 'v1.2.3-name-branch'
value: ${{ steps.parser.outputs.short_version }}
tag_version:
description: 'v1.2.3-name'
value: ${{ steps.parser.outputs.tag_version }}
next_full_version:
description: 'v1.3.0-name-branch'
description: 'v1.3.0-name-branch-shortsha'
value: ${{ steps.parser.outputs.next_full_version }}
next_short_version:
description: 'v1.3.0-name-branch'
value: ${{ steps.parser.outputs.next_short_version }}
next_tag_version:
description: 'v1.3.0-name'
value: ${{ steps.parser.outputs.next_tag_version }}
Expand All @@ -41,38 +47,53 @@ runs:
MINOR="${BASH_REMATCH[2]}"
BUILD="${BASH_REMATCH[3]}"
NAME="${BASH_REMATCH[4]}"
echo "Version parsed match:"
echo "[Major]: $MAJOR"
echo "[Minor]: $MINOR"
echo "[Build]: $BUILD"
echo "[Name]: $NAME"
else
echo "Failling! Tag does not match expected format: $TAG"
echo "Failing! Tag does not match expected format: $TAG"
exit 1
fi
# Not sure this works as expected!
# Determine the branch name
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
BRANCH_NAME="$GITHUB_HEAD_REF"
else
BRANCH_NAME=$(echo "$GITHUB_REF" | cut -d'/' -f 3)
fi
COMMIT_HASH=${GITHUB_SHA}
FULLVER="v${MAJOR}.${MINOR}.$((BUILD))-${NAME}-${BRANCH_NAME}-${COMMIT_HASH}"
# Get the shortened commit hash
SHORT_COMMIT_HASH=$(echo "$GITHUB_SHA" | cut -c1-7)
# Full version with commit hash
FULLVER="v${MAJOR}.${MINOR}.$((BUILD))-${NAME}-${BRANCH_NAME}-${SHORT_COMMIT_HASH}"
echo "Full version: $FULLVER"
echo "full_version=$FULLVER" >> "$GITHUB_OUTPUT"
TAGVER="v${MAJOR}.${MINOR}.$((BUILD + COMMITS_SINCE))-${NAME}"
# Short version without commit hash
SHORTVER="v${MAJOR}.${MINOR}.$((BUILD))-${NAME}-${BRANCH_NAME}"
echo "Short version: $SHORTVER"
echo "short_version=$SHORTVER" >> "$GITHUB_OUTPUT"
# Tag version
TAGVER="v${MAJOR}.${MINOR}.$((BUILD))-${NAME}"
echo "Tag version: $TAGVER"
echo "tag_version=$TAGVER" >> "$GITHUB_OUTPUT"
NEXT_FULLVER="v${MAJOR}.$((MINOR + 1)).0-${NAME}-${BRANCH_NAME}-${COMMIT_HASH}"
# Next full version with commit hash
NEXT_FULLVER="v${MAJOR}.$((MINOR + 1)).0-${NAME}-${BRANCH_NAME}-${SHORT_COMMIT_HASH}"
echo "Next full version: $NEXT_FULLVER"
echo "next_full_version=$NEXT_FULLVER" >> "$GITHUB_OUTPUT"
# Next short version without commit hash
NEXT_SHORTVER="v${MAJOR}.$((MINOR + 1)).0-${NAME}-${BRANCH_NAME}"
echo "Next short version: $NEXT_SHORTVER"
echo "next_short_version=$NEXT_SHORTVER" >> "$GITHUB_OUTPUT"
# Next tag version without branch or commit hash
NEXT_TAGVER="v${MAJOR}.$((MINOR + 1)).0-${NAME}"
echo "Next tag version: $NEXT_TAGVER"
echo "next_tag_version=$NEXT_TAGVER" >> "$GITHUB_OUTPUT"
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/auto-sync-main-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ name: Create PR for syncing main to dev
on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
build:
create-pr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Check out the code
uses: actions/checkout@v4

- name: Create or update branch
run: |
git checkout -B chore/sync
git push --force --set-upstream origin chore/sync
- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: "chore/sync" # If blank, default: triggered branch
destination_branch: "dev" # If blank, default: master
pr_title: "chore: sync main to dev" # Title of pull request
pr_body: | # Full markdown support, requires pr_title to be set
:crown: *An automated PR*
pr_label: "auto-pr" # Comma-separated list (no spaces)
pr_draft: false # Creates pull request as draft
pr_allow_empty: false # Creates pull request even if there are no changes
github_token: ${{ github.token }} # If blank, default: secrets.GITHUB_TOKEN
- name: Create pull request using GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base dev \
--head chore/sync \
--title "chore: sync main to dev" \
--body ":crown: *An automated PR*" \
--label auto-pr \
5 changes: 3 additions & 2 deletions .github/workflows/build-profile-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
timeout-minutes: 5
outputs:
latest_version: ${{ steps.get_version.outputs.latest_version }}
full_version: ${{ steps.get_version.outputs.next_full_version }}
tag_version: ${{ steps.get_version.outputs.next_tag_version }}
full_version: ${{ steps.get_version.outputs.short_version }}
tag_version: ${{ steps.get_version.outputs.tag_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -34,5 +34,6 @@ jobs:
version: ${{ needs.get-info.outputs.full_version }}
sentry_enabled: true
is_release_build: false
install_source: launcher
tag_version: ${{ needs.get-info.outputs.tag_version }}
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/build-release-main-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ jobs:
files: |
./Decentraland_windows64.zip
./Decentraland_macos.zip
./Decentraland_windows64_epic.zip
./Decentraland_macos_epic.zip
fail_on_unmatched_files: true
13 changes: 7 additions & 6 deletions .github/workflows/build-release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ on:
push:
branches:
- main
# schedule:
# - cron: '10 0 * * 3'

jobs:
get-info:
name: Get Info
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
latest_version: ${{ steps.get_version.outputs.latest_version }}
full_version: ${{ steps.get_version.outputs.next_full_version }}
version: ${{ steps.get_version.outputs.next_short_version }}
tag_version: ${{ steps.get_version.outputs.next_tag_version }}
steps:
- name: Checkout code
Expand All @@ -31,13 +28,17 @@ jobs:
build:
name: Build Unity Cloud
needs: get-info
strategy:
matrix:
install_source: ['launcher', 'epic']
uses: ./.github/workflows/build-unitycloud.yml
with:
profile: none
clean_build: true
cache_strategy: none
version: ${{ needs.get-info.outputs.full_version }}
version: ${{ needs.get-info.outputs.next_short_version }}
sentry_enabled: true
is_release_build: true
install_source: ${{ matrix.install_source }}
tag_version: ${{ needs.get-info.outputs.tag_version }}
secrets: inherit
secrets: inherit
48 changes: 34 additions & 14 deletions .github/workflows/build-unitycloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ on:
- library
- workspace
- inherit
version:
description: 'Override for build version to use'
required: false
default: ''
type: string
workflow_call:
inputs:
profile:
Expand All @@ -68,6 +63,10 @@ on:
type: boolean
required: false
default: false
install_source:
required: false
default: 'launcher'
type: string
tag_version:
type: string
required: false
Expand Down Expand Up @@ -97,6 +96,7 @@ jobs:
sentry_enabled: ${{ steps.get_sentry.outputs.sentry_enabled }}
clean_build: ${{ steps.set_defaults.outputs.clean_build }}
cache_strategy: ${{ steps.set_defaults.outputs.cache_strategy }}
install_source: ${{ steps.set_defaults.outputs.install_source }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -153,6 +153,16 @@ jobs:
echo "Set cache_strategy to: $cache_strategy"
echo "cache_strategy=${cache_strategy}" >> $GITHUB_OUTPUT
if [ "${{ github.event.inputs.install_source }}" ]; then
install_source=${{ github.event.inputs.install_source }}
elif [ "${{ inputs.install_source }}" ]; then
install_source=${{ inputs.install_source }}
else
install_source='launcher'
fi
echo "Set install_source to: $install_source"
echo "install_source=${install_source}" >> $GITHUB_OUTPUT
- name: Get BuildOptions
id: get_options
run: |
Expand Down Expand Up @@ -230,19 +240,29 @@ jobs:
PARAM_SENTRY_ENABLED: ${{ needs.prebuild.outputs.sentry_enabled }}
PARAM_SENTRY_UPLOAD_DEBUG_SYMBOLS: ${{ needs.prebuild.outputs.sentry_upload_symbols }}
PARAM_SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
PARAM_INSTALL_SOURCE: ${{ needs.prebuild.outputs.install_source }}

run: python -u scripts/cloudbuild/build.py

- name: 'Tar artifact to maintain original permissions'
if: matrix.target == 'macos'
run: tar --exclude='build/Decentraland_BackUpThisFolder_ButDontShipItWithYourGame' -cvf build.tar build

- name: Set artifact name
id: set_artifact_name
run: |
if [ "${{ needs.prebuild.outputs.install_source }}" == "launcher" ]; then
echo "artifact_name=Decentraland_${{ matrix.target }}" >> $GITHUB_ENV
else
echo "artifact_name=Decentraland_${{ matrix.target }}_${{ needs.prebuild.outputs.install_source }}" >> $GITHUB_ENV
fi
- name: Upload artifact for macOS
id: upload-macos-artifact
if: matrix.target == 'macos'
uses: actions/upload-artifact@v4
with:
name: Decentraland_${{ matrix.target }}
name: ${{ env.artifact_name }}
path: build.tar
if-no-files-found: error

Expand All @@ -251,7 +271,7 @@ jobs:
if: matrix.target == 'windows64'
uses: actions/upload-artifact@v4
with:
name: Decentraland_${{ matrix.target }}
name: ${{ env.artifact_name }}
path: |
build
!build/**/*_BackUpThisFolder_ButDontShipItWithYourGame
Expand All @@ -262,18 +282,18 @@ jobs:
run: |
mkdir upload_to_s3/ && \
if [ "${{ matrix.target }}" == "macos" ]; then
zip -r upload_to_s3/Decentraland_${{ matrix.target }}.zip build.tar
zip -r upload_to_s3/${{ env.artifact_name }}.zip build.tar
elif [ "${{ matrix.target }}" == "windows64" ]; then
cd build
zip -r ../upload_to_s3/Decentraland_${{ matrix.target }}.zip . -x "*_BackUpThisFolder_ButDontShipItWithYourGame**" -x "*_BurstDebugInformation_DoNotShip**"
zip -r ../upload_to_s3/${{ env.artifact_name }}.zip . -x "*_BackUpThisFolder_ButDontShipItWithYourGame**" -x "*_BurstDebugInformation_DoNotShip**"
fi
- name: Upload artifact to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
EXPLORER_TEAM_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}
DESTINATION_PATH: ${{ inputs.tag_version && format('@dcl/{0}/releases/{1}', github.event.repository.name, inputs.tag_version) || format('@dcl/{0}/branch/{1}', github.event.repository.name, github.head_ref || github.ref_name) }}
DESTINATION_PATH: ${{ inputs.is_release_build && format('@dcl/{0}/releases/{1}', github.event.repository.name, inputs.tag_version) || format('@dcl/{0}/branch/{1}', github.event.repository.name, github.head_ref || github.ref_name) }}
run: |
npx @dcl/cdn-uploader@next \
--bucket $EXPLORER_TEAM_S3_BUCKET \
Expand All @@ -283,7 +303,7 @@ jobs:
- name: Upload debug symbols
uses: actions/upload-artifact@v4
with:
name: Decentraland_${{ matrix.target }}_debug_symbols
name: ${{ env.artifact_name }}_debug_symbols
path: |
build/**/*_BackUpThisFolder_ButDontShipItWithYourGame
build/**/*_BurstDebugInformation_DoNotShip
Expand All @@ -294,7 +314,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}_unity_log
name: ${{ matrix.target }}_${{ needs.prebuild.outputs.install_source }}_unity_log
path: unity_cloud_log.log
if-no-files-found: error

Expand All @@ -306,7 +326,7 @@ jobs:
- name: Extract and display errors
if: always()
run: |
echo "=== Extracted Errors for ${{ matrix.target }} ==="
echo "=== Extracted Errors for ${{ matrix.target }} ${{ needs.prebuild.outputs.install_source }} ==="
grep -iE "error c|fatal" unity_cloud_log.log | sed 's/^/\x1b[31m/' | sed 's/$/\x1b[0m/' || echo "No 'error c' or 'fatal' errors found in ${{ matrix.target }} log."
# Will run always (even if failing)
Expand All @@ -319,7 +339,7 @@ jobs:
- name: Upload Shader Compilation Report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}_shader_compilation_report
name: ${{ matrix.target }}_${{ needs.prebuild.outputs.install_source }}_shader_compilation_report
path: shader_compilation_report.log
if-no-files-found: error

Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create Release Branch and PR

on:
workflow_dispatch:

jobs:
create-release-branch:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v4
with:
ref: dev

- name: Get current date
id: get_date
run: echo "current_date=$(date +"%d-%m-%Y")" >> $GITHUB_ENV

- name: Create or update branch
run: |
git checkout -B release/release-${{ env.current_date }}
git push --force --set-upstream origin release/release-${{ env.current_date }}
- name: Create pull request using GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base main \
--head release/release-${{ env.current_date }} \
--title "release: ${{ env.current_date }}" \
--body ":rocket: Automated release PR" \
--label release,auto-pr \
Loading

0 comments on commit 46a6a9a

Please sign in to comment.