Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sync with main #34

Merged
merged 10 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 28 additions & 16 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
- `build-docs.yaml`:
Build Packager docs. Runs only on Linux.

- `docker-image.yaml`:
- `build-docker.yaml`:
Build the official Docker image.

- `lint.yaml`:
Lint Shaka Packager.

- `publish-docs.yaml`:
Publish Packager docs. Runs on the latest release.

- `publish-docker.yaml`:
Publish the official docker image. Runs on all releases.

- `publish-npm.yaml`:
Publish binaries to NPM. Runs on all releases.

- `test-linux-distros.yaml`:
Test the build on all Linux distros via docker.

Expand All @@ -22,30 +31,33 @@
- `lint.yaml`
- `build.yaml`
- `build-docs.yaml`
- `docker-image.yaml`
- `build-docker.yaml`
- `test-linux-distros.yaml`

- On release tag (`github-release.yaml`):
- Create a draft release
- Invoke:
- `lint.yaml`
- `build.yaml`
- `test-linux-distros.yaml`
- Publish the release with binaries from `build.yaml` attached

- On release published:
- `docker-hub-release.yaml`, publishes the official Docker image
- `npm-release.yaml`, publishes the official NPM package
- `update-docs.yaml`:
- Invoke `build-docs.yaml`
- Push the output to the `gh-pages` branch
## Release workflow
- `release-please.yaml`
- Updates changelogs, version numbers based on conventional commits syntax
and semantic versioning
- https://conventionalcommits.org/
- https://semver.org/
- Generates/updates a PR on each push
- When the PR is merged, runs additional steps:
- Creates a GitHub release
- Invokes `publish-docs.yaml` to publish the docs
- Invokes `publish-docker.yaml` to publish the docker image
- Invokes `build.yaml`
- Attaches the binaries from `build.yaml` to the GitHub release
- Invokes `publish-npm.yaml` to publish the binaries to NPM

## Common workflows from shaka-project
- `sync-labels.yaml`
- `update-issues.yaml`
- `validate-pr-title.yaml`

## Required Repo Secrets
- `RELEASE_PLEASE_TOKEN`: A PAT for `shaka-bot` to run the `release-please`
action. If missing, the release workflow will use the default
`GITHUB_TOKEN`
- `DOCKERHUB_CI_USERNAME`: The username of the Docker Hub CI account
- `DOCKERHUB_CI_TOKEN`: An access token for Docker Hub
- To generate, visit https://hub.docker.com/settings/security
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-attach-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ jobs:
echo "::endgroup::"

SUFFIX="-${{ matrix.os_name }}-${{ matrix.target_arch }}"
EXE_SUFFIX="$SUFFIX${{ matrix.exe_ext}}"
LIB_SUFFIX="$SUFFIX${{ matrix.lib_ext}}"

echo "::group::Copy libpackager"
cp libpackager${{ matrix.exe_ext }} $ARTIFACTS/libpackager$EXE_SUFFIX
cp libpackager${{ matrix.lib_ext }} $ARTIFACTS/libpackager$LIB_SUFFIX
echo "::endgroup::"

- name: Upload release build artifacts
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2022 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

# A workflow to build the official docker image.
name: Official Docker image

# Runs when called from another workflow.
on:
workflow_call:
inputs:
ref:
required: true
type: string

# By default, run all commands in a bash shell. On Windows, the default would
# otherwise be powershell.
defaults:
run:
shell: bash

jobs:
official_docker_image:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
submodules: recursive

- name: Build
shell: bash
run: docker buildx build .
15 changes: 12 additions & 3 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- name: Install dependencies
run: |
sudo apt install -y doxygen
sudo apt install -y doxygen graphviz
python3 -m pip install \
sphinx==7.1.2 \
sphinxcontrib.plantuml \
Expand All @@ -40,7 +40,7 @@ jobs:
breathe

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

Expand All @@ -61,8 +61,17 @@ jobs:
cp -a build/doxygen/html gh-pages/docs
cp docs/index.html gh-pages/index.html

# Now set permissions on the generated docs.
# https://github.com/actions/upload-pages-artifact#file-permissions
chmod -R +rX gh-pages/

- name: Upload docs artifacts
uses: actions/upload-pages-artifact@v3
with:
path: gh-pages

- name: Debug
uses: mxschmitt/action-tmate@v3.6
uses: mxschmitt/action-tmate@v3.17
with:
limit-access-to-actor: true
if: failure() && inputs.debug
11 changes: 7 additions & 4 deletions .github/workflows/build-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
"os": "ubuntu-20.04",
"os_name": "linux",
"target_arch": "x64",
"exe_ext": ".so",
"lib_ext": ".so",
"exe_ext": "",
"generator": "Ninja"
},
{
"comment": "Explicit macOS version 13 is required for explicit x64 CPU.",
"os": "macos-13",
"os_name": "osx",
"target_arch": "x64",
"exe_ext": ".dylib",
"lib_ext": ".dylib",
"exe_ext": "",
"generator": "Ninja"
},
{
"comment": "Explicit macOS version 14 is required for explicit arm64 CPU.",
"os": "macos-14",
"os_name": "osx",
"target_arch": "arm64",
"exe_ext": ".dylib",
"lib_ext": ".dylib",
"exe_ext": "",
"generator": "Ninja"
}
]
}
}
Loading
Loading