Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,36 @@ on:
tags:
- v*.*
jobs:
check-version:
runs-on: ubuntu-latest
name: Check Tag Matches Manifests
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Compare the tag with both manifests
run: |
# The committed manifests carry the version and ship as is, so a tag
# build has to match both before either platform can be released.
if [[ $GITHUB_REF != refs/tags/v* ]]; then
exit 0
fi

TAG_VERSION=${GITHUB_REF#refs/tags/v}
STATUS=0
for MANIFEST in src/manifest-chrome.json src/manifest-firefox.json; do
MANIFEST_VERSION=$(jq -r .version "$MANIFEST")
if [[ "$TAG_VERSION" != "$MANIFEST_VERSION" ]]; then
echo "::error::Tag v$TAG_VERSION does not match $MANIFEST version $MANIFEST_VERSION. Bump both manifests on master, then tag that commit."
STATUS=1
fi
done
exit $STATUS

build:
runs-on: ubuntu-latest
name: Build and Generate Artifact
needs: check-version
permissions:
id-token: write
contents: write
Expand All @@ -26,16 +53,7 @@ jobs:
uses: actions/checkout@v7

- name: Prepare manifest.json
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
export SCREENLY_CE_VERSION=${GITHUB_REF#refs/tags/v}
else
export SCREENLY_CE_VERSION="0.0.0"
fi

cat src/manifest-${{ matrix.platform }}.json \
| jq --arg version "$SCREENLY_CE_VERSION" '.version = $version' \
> src/manifest.json
run: cp src/manifest-${{ matrix.platform }}.json src/manifest.json

- name: Build Docker images
run: |
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ jobs:
uses: actions/checkout@v7

- name: Prepare manifest.json
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
export SCREENLY_CE_VERSION=${GITHUB_REF#refs/tags/v}
else
export SCREENLY_CE_VERSION="0.0.0"
fi

cat src/manifest-${{ matrix.platform }}.json \
| jq --arg version "$SCREENLY_CE_VERSION" '.version = $version' \
> src/manifest.json
run: cp src/manifest-${{ matrix.platform }}.json src/manifest.json

- name: Build Docker images
run: |
Expand Down
9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ which is what `build.yaml` triggers on.
both on `master` first, then tag that commit, and keep the tag and the manifests
equal.

Nothing checks that yet. `build.yaml` and `test.yaml` still derive `.version`
from the git ref and write it over the manifest on the way into the build, which
is how the committed number came to differ from every released one. Replacing
that with a check is a follow-up; until it lands, the tag and the manifests
agreeing is a convention rather than a guarantee.
`build.yaml` enforces this: on a tag, a check job compares the tag with both
manifests and the builds only start once it passes, so a mismatch stops the
release for both platforms. The manifests are copied into the build unchanged,
so what you commit is what ships.

`package.json` is the build tooling's own manifest (`sce-webpack`, `private`),
not the extension's. Its version is unrelated and is not bumped for a release.
Expand Down
Loading