-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Extract install-action-manifest-schema and publish to crates-io #657
Open
NobodyXu
wants to merge
24
commits into
main
Choose a base branch
from
refactor/new-crate-for-parsing-manifest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+687
−378
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4637998
Extract manifest-schema and publish to crates-io
NobodyXu ae50c4d
Set install-action-internal-codegen to publish=false
NobodyXu d553f9c
Rename crate to install-action-manifest-schema
NobodyXu 5014667
Add GHA workflow `manifest-sync.yml`
NobodyXu d4b617c
Add `MANIFEST_SCHEMA_BRANCH_NAME` to manifest-schema
NobodyXu 207eeeb
Fix `Show diff` step in `manifest_sync.yml`
NobodyXu f667532
Fix `checkout-manifest-schema-branch.sh`
NobodyXu 9e1fdfc
Remove unused key in concurrency group
NobodyXu 054782f
Update tools/checkout-manifest-schema-branch.sh
NobodyXu 9498496
Run `manifest_sync.yml` on release
NobodyXu 0319866
Revert unnecessary `publish = false` in `codegen/Cargo.toml`
NobodyXu 2360c8b
Make getting version of install-action-manifest-schema more robust
NobodyXu 8b80c3f
Update tools/checkout-manifest-schema-branch.sh
NobodyXu 061321d
Add license to install-action-manifest-schema
NobodyXu e64fbb2
Fix checkout-manifest-schema-branch.sh fmt
NobodyXu 64ceee1
Fix speeing
NobodyXu 3e1c3fb
Add license line to checkout-manifest-schema-branch.sh
NobodyXu 3bdda34
Fix manifest_sync.yml: Limit permission `contents: read`
NobodyXu bcbd71a
Fix file-permissions-check in tools/tidy.sh
NobodyXu b768746
Update tools/codegen/Cargo.toml
taiki-e e0d9941
Update tools/tidy.sh
taiki-e 42ee9cd
Merge branch 'main' into refactor/new-crate-for-parsing-manifest
taiki-e 783123c
touch up
taiki-e bbf1578
mv script to correct dir
taiki-e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ syft | |
udeps | ||
wasmtime | ||
watchexec | ||
worktree | ||
xbuild | ||
xscale | ||
zigbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Manifest Synchronization | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
env: | ||
WORKSPACE: /tmp/workspace | ||
|
||
defaults: | ||
run: | ||
shell: bash --noprofile --norc -CeEuxo pipefail {0} | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: true | ||
|
||
- name: Checkout manifest-schema branch | ||
run: ./tools/ci/checkout-manifest-schema-branch.sh $WORKSPACE | ||
|
||
- name: Copy over schema | ||
run: cp ./manifests/* $WORKSPACE | ||
|
||
- name: Stage changes | ||
working-directory: ${{ env.WORKSPACE }} | ||
run: git add . | ||
|
||
- name: Show diff | ||
working-directory: ${{ env.WORKSPACE }} | ||
run: git diff HEAD | ||
|
||
- name: Detect changes | ||
id: changes | ||
working-directory: ${{ env.WORKSPACE }} | ||
run: | | ||
# This output boolean tells us if the dependencies have actually changed | ||
echo "count=$(git status --porcelain=v1 | wc -l)" >> $GITHUB_OUTPUT | ||
|
||
- name: Commit and push | ||
# Only push if changes exist | ||
if: steps.changes.outputs.count > 0 | ||
working-directory: ${{ env.WORKSPACE }} | ||
run: | | ||
git commit -m "Update manifest schema" && git push origin HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
set -euxo pipefail | ||
|
||
cd "$(dirname "$0")" | ||
|
||
schema_version="$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "install-action-manifest-schema") | .version')" | ||
branch="manifest-schema-${schema_version}" | ||
|
||
git worktree add --force "${1?}" | ||
cd "$1" | ||
|
||
if git fetch origin "${branch}"; then | ||
git checkout "origin/${branch}" -B "${branch}" | ||
elif ! git checkout "${branch}"; then | ||
# New branch with no history. Credit: https://stackoverflow.com/a/13969482 | ||
git checkout --orphan "${branch}" | ||
git rm -rf . || true | ||
git config --local user.name github-actions | ||
git config --local user.email [email protected] | ||
git commit -m 'Initial commit' --allow-empty | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But branch name here is
manifest-schema-<major>.<minor>.<patch>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use
manifest-schema-<major>.<minor>
until manifest-schema crate become 1.x, as I said in #657 (comment).