Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jun 10, 2024
2 parents 0280a5b + e868ba6 commit abd9d11
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ jobs:
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]] && [[ "${{ github.repository }}" == "mixxxdj/mixxx" ]]; then
CPACK_ARGS="-D DEB_UPLOAD_PPA=ppa:mixxx/nightlies"
elif [[ "${{ github.ref }}" == "refs/heads/2.4" ]] && [[ "${{ github.repository }}" == "mixxxdj/mixxx" ]]; then
elif [[ "${{ github.ref }}" == "refs/heads/2.5" ]] && [[ "${{ github.repository }}" == "mixxxdj/mixxx" ]]; then
CPACK_ARGS="-D DEB_UPLOAD_PPA=ppa:mixxx/mixxxbetas"
elif [[ "${{ github.ref }}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]] && [[ "${{ github.repository }}" == "mixxxdj/mixxx" ]]; then
CPACK_ARGS="-D DEB_UPLOAD_PPA=ppa:mixxx/mixxx"
Expand Down
4 changes: 2 additions & 2 deletions src/control/controlvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ class ControlValueAtomicBase {
// Specialized template for types that are deemed to be atomic on the target
// architecture. Instead of using a read/write ring to guarantee atomicity,
// direct assignment/read of an aligned member variable is used.
template <typename T>
class ControlValueAtomicBase<T, true> {
template<typename T, int cRingSize>
class ControlValueAtomicBase<T, cRingSize, true> {
public:
inline T getValue() const {
return m_value;
Expand Down
1 change: 1 addition & 0 deletions src/dialog/dlgabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ DlgAbout::DlgAbout()
<< "Nicolau Leal Werneck"
<< "David Guglielmi"
<< "Chris H. Meyer"
<< "Mariano Ntrougkas"
<< "Daniel Fernandes"
<< "Gr&eacute;goire Locqueville"
<< "grizeldi"
Expand Down
55 changes: 33 additions & 22 deletions tools/deploy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3

import argparse
import datetime
import functools
Expand Down Expand Up @@ -40,7 +41,7 @@ def url_exists(url):


def url_download_json(url):
"""Returns the JSON object from the given URL or return None."""
"""Returns the JSON object from the given URL or returns None."""
resp = url_fetch(url)
if resp.status != 200:
raise IOError(f"Server responded with HTTP status {resp.status}")
Expand Down Expand Up @@ -118,8 +119,12 @@ def prepare_deployment(args):
logger = logging.getLogger(__name__)

# Get artifact and build metadata
file_stat = os.stat(args.file)
file_sha256 = sha256(args.file)
try:
file_stat = os.stat(args.file)
file_sha256 = sha256(args.file)
except Exception as e:
logger.error("Error accessing file: %s", e)
return 1

try:
commit_id = os.environ["GITHUB_SHA"]
Expand Down Expand Up @@ -194,16 +199,16 @@ def prepare_deployment(args):
# Write metadata to GitHub Actions step output, so that it can be used for
# manifest creation in the final job after all builds finished.
if os.getenv("CI") == "true":
# Set GitHub Actions job output
print(
'echo "{artifact-'
+ download_slug
+ "-"
+ package_slug
+ "}={"
+ json.dumps(metadata)
+ '}" >> $GITHUB_OUTPUT'
)
# Set GitHub Actions job output using environment files
output_file = os.getenv("GITHUB_OUTPUT")
with open(output_file, "a") as f:
f.write(
"artifact-{}-{}={}\n".format(
download_slug,
package_slug,
json.dumps(metadata),
)
)
return 0


Expand All @@ -225,9 +230,15 @@ def collect_manifest_data(job_data):
url = artifact_data["file_url"]

# Make sure that the file actually exists on the download server
resp = url_fetch(url, method="HEAD")
if not resp.status == 200:
raise LookupError(f"Unable to find URL '{url}' on remote server")
try:
resp = url_fetch(url, method="HEAD")
if resp.status != 200:
raise LookupError(
f"Unable to find URL '{url}' on remote server"
)
except Exception as e:
logger.error("Error checking URL: %s", e)
raise

manifest_data[artifact_slug] = artifact_data

Expand Down Expand Up @@ -270,8 +281,8 @@ def generate_manifest(args):

try:
remote_manifest_data = url_download_json(manifest_url) or {}
except IOError:
logger.error("Fetching remote manifest failed!")
except IOError as e:
logger.error("Fetching remote manifest failed: %s", e)

if args.update:
for key, value in remote_manifest_data.items():
Expand Down Expand Up @@ -306,20 +317,20 @@ def main(argv=None):
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()

parent_parser = argparse.ArgumentParser()
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser.add_argument(
"-v",
"--verbose",
action="store_const",
dest="loglevel",
const=logging.DEBUG,
default=logging.INFO,
help="Fetch the remote manifest and update it ",
help="Increase output verbosity",
)

artifact_parser = subparsers.add_parser(
"prepare-deployment",
help=" artifact metadata from file",
help="Prepare artifact metadata from file",
parents=[parent_parser],
add_help=False,
)
Expand Down Expand Up @@ -378,7 +389,7 @@ def main(argv=None):
manifest_parser.add_argument(
"--update",
action="store_true",
help="Fetch the remote manifest and update it ",
help="Fetch the remote manifest and update it",
)

args = parser.parse_args(argv)
Expand Down

0 comments on commit abd9d11

Please sign in to comment.