Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,41 @@ function() std.manifestYamlDoc(
},
permissions: {},
jobs: {
release: {
"check-runner": {
"runs-on": "ubuntu-latest",
outputs: {
runner: "${{ steps.env.outputs.runner }}",
build_env: "${{ steps.env.outputs.build_env }}",
},
steps: [
{
name: "Checkout",
uses: "actions/checkout@v7",
},
{
name: "Determine runner and build env",
id: "env",
shell: "bash",
run: |||
if [[ -f .github/local/runner ]]; then
runner="$(head -1 .github/local/runner)"
echo "runner=$runner" | tee -a "$GITHUB_OUTPUT"
else
runner="ubuntu-latest"
echo "runner=$runner" | tee -a "$GITHUB_OUTPUT"
fi
if echo "$runner" | grep -q arm; then
echo "build_env=host" | tee -a "$GITHUB_OUTPUT"
else
echo "build_env=devcontainer" | tee -a "$GITHUB_OUTPUT"
fi
|||,
},
],
},
release: {
"runs-on": "${{ needs.check-runner.outputs.runner }}",
needs: "check-runner",
permissions: {
contents: "write",
},
Expand Down Expand Up @@ -55,13 +88,15 @@ function() std.manifestYamlDoc(
},
{
name: "Set up QEMU Emulation",
"if": "${{ needs.check-runner.outputs.build_env != 'host' }}",
uses: "docker/setup-qemu-action@v4",
with: {
image: "tonistiigi/binfmt:latest",
},
},
{
name: "Test",
"if": "${{ needs.check-runner.outputs.build_env == 'devcontainer' }}",
uses: "devcontainers/ci@v0.3",
with: {
push: "never",
Expand All @@ -78,6 +113,23 @@ function() std.manifestYamlDoc(
|||,
},
},
{
name: "Test",
"if": "${{ needs.check-runner.outputs.build_env == 'host' }}",
shell: "bash",
run: |||
set -euo pipefail
sudo apt-get update
sudo apt-get install --no-install-recommends -y git-buildpackage
sudo apt-get build-dep . -y
export DEBEMAIL="dev@radxa.com"
export DEBFULLNAME='"Radxa Computer Co., Ltd"'
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
make dch
make test deb
|||,
},
{
name: "Push",
"if": "github.event.inputs.release == 'true'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,48 @@ function() std.manifestYamlDoc(
},
permissions: {},
jobs: {
build: {
"check-runner": {
"runs-on": "ubuntu-latest",
outputs: {
runner: "${{ steps.env.outputs.runner }}",
build_env: "${{ steps.env.outputs.build_env }}",
},
steps: [
{
name: "Checkout",
uses: "actions/checkout@v6",
},
{
name: "Determine runner and build env",
id: "env",
shell: "bash",
run: |||
if [[ -f .github/local/runner ]]; then
runner="$(head -1 .github/local/runner)"
echo "runner=$runner" | tee -a "$GITHUB_OUTPUT"
else
runner="ubuntu-latest"
echo "runner=$runner" | tee -a "$GITHUB_OUTPUT"
fi
if echo "$runner" | grep -q arm; then
echo "build_env=host" | tee -a "$GITHUB_OUTPUT"
else
echo "build_env=devcontainer" | tee -a "$GITHUB_OUTPUT"
fi
|||,
},
],
},
build: {
"runs-on": "${{ needs.check-runner.outputs.runner }}",
needs: "check-runner",
outputs: {
distro: "${{ steps.distro_check.outputs.distro }}",
},
steps: [
{
name: "Checkout",
uses: "actions/checkout@v7",
uses: "actions/checkout@v6",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码需要rebase

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我的意思是你的pr需要rebase,咋还来降级了

with: {
"fetch-depth": 0,
"fetch-tags": true,
Expand All @@ -46,13 +79,15 @@ function() std.manifestYamlDoc(
},
{
name: "Set up QEMU Emulation",
"if": "${{ needs.check-runner.outputs.build_env != 'host' }}",
uses: "docker/setup-qemu-action@v4",
with: {
image: "tonistiigi/binfmt:latest",
},
},
{
name: "Test",
"if": "${{ needs.check-runner.outputs.build_env == 'devcontainer' }}",
uses: "devcontainers/ci@v0.3",
with: {
push: "never",
Expand All @@ -74,8 +109,31 @@ function() std.manifestYamlDoc(
|||,
},
},
{
name: "Test",
"if": "${{ needs.check-runner.outputs.build_env == 'host' }}",
shell: "bash",
run: |||
set -euo pipefail
sudo apt-get update
sudo apt-get install --no-install-recommends -y git-buildpackage
sudo apt-get build-dep . -y
export DEBEMAIL="dev@radxa.com"
export DEBFULLNAME='"Radxa Computer Co., Ltd"'
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git branch -m GITHUB_RUNNER || true
git branch -D main || true
git switch -c main || true
make dch
make test deb
git reset --hard HEAD~1
rm ../*.deb
|||,
},
{
name: "Build",
"if": "${{ needs.check-runner.outputs.build_env == 'devcontainer' }}",
uses: "devcontainers/ci@v0.3",
with: {
push: "never",
Expand All @@ -85,6 +143,15 @@ function() std.manifestYamlDoc(
|||,
},
},
{
name: "Build",
"if": "${{ needs.check-runner.outputs.build_env == 'host' }}",
shell: "bash",
run: |||
set -euo pipefail
make deb
|||,
},
{
name: "Workaround actions/upload-artifact#176",
id: "artifacts_path",
Expand All @@ -110,7 +177,6 @@ function() std.manifestYamlDoc(
run: |||
version="$(dpkg-parsechangelog -S Version)"
version="${version//\~/.}"
version="${version#*:}"
if [[ -n "$(git tag -l "$version")" ]]
then
echo "distro=UNRELEASED"
Expand All @@ -122,16 +188,19 @@ function() std.manifestYamlDoc(
],
},
release: {
"runs-on": "ubuntu-latest",
needs: "build",
"runs-on": "${{ needs.check-runner.outputs.runner }}",
needs: [
"check-runner",
"build",
],
permissions: {
contents: "write",
},
"if": "${{ github.event_name != 'pull_request' && needs.build.outputs.distro != 'UNRELEASED' }}",
steps: [
{
name: "Checkout",
uses: "actions/checkout@v7",
uses: "actions/checkout@v6",
},
{
name: "Download generated debs",
Expand All @@ -147,7 +216,6 @@ function() std.manifestYamlDoc(
run: |||
version="$(dpkg-parsechangelog -S Version)"
version="${version//\~/.}"
version="${version#*:}"
{
echo "version=$version"
echo "changes<<EOF"
Expand Down
Loading