diff --git a/.github/workflows/release-gitflow.yml b/.github/workflows/release-gitflow.yml index 8497ab7c3..735f06e53 100644 --- a/.github/workflows/release-gitflow.yml +++ b/.github/workflows/release-gitflow.yml @@ -12,6 +12,10 @@ on: description: List of dependencies to reset. type: string required: false + dir: + description: The directory to release + type: string + default: "." concurrency: ${{ github.workflow }} permissions: {} # Uses ELEMENT_BOT_TOKEN jobs: @@ -54,6 +58,7 @@ jobs: - name: Reset dependencies if: inputs.dependencies + working-directory: ${{ inputs.dir }} run: | while IFS= read -r PACKAGE; do [ -z "$PACKAGE" ] && continue diff --git a/.github/workflows/release-make.yml b/.github/workflows/release-make.yml index 29b12db73..bdfcedda1 100644 --- a/.github/workflows/release-make.yml +++ b/.github/workflows/release-make.yml @@ -26,12 +26,17 @@ on: description: | The path to the asset you want to upload, if any. You can use glob patterns here. Will be GPG signed and an `.asc` file included in the release artifacts if `gpg-fingerprint` is set. + Relative to `dir`. type: string required: false expected-asset-count: description: The number of expected assets, including signatures, excluding generated zip & tarball. type: number required: false + dir: + description: The directory to release + type: string + default: "." outputs: npm-id: description: "The npm package@version string we published" @@ -90,6 +95,7 @@ jobs: - name: Prepare variables id: prepare + working-directory: ${{ inputs.dir }} run: | echo "VERSION=$VERSION" >> $GITHUB_ENV @@ -127,12 +133,13 @@ jobs: - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: cache: "pnpm" - node-version-file: package.json + node-version-file: ${{ inputs.dir }}/package.json - name: Install dependencies run: "pnpm install --frozen-lockfile" - name: Handle develop dependencies + working-directory: ${{ inputs.dir }} run: | ret=0 cat package.json | jq -r '.dependencies | to_entries | .[] | "\(.key) \(.value)"' | grep '#develop$' | while read -r dep ; do @@ -147,6 +154,7 @@ jobs: done - name: Bump package.json version + working-directory: ${{ inputs.dir }} run: | pnpm version --no-git-tag-version "${VERSION#v}" git add package.json @@ -176,6 +184,7 @@ jobs: - name: Build assets if: steps.prepare.outputs.has-dist-script == '1' + working-directory: ${{ inputs.dir }} run: DIST_VERSION="$VERSION" pnpm dist - name: Upload release assets & signatures @@ -184,7 +193,7 @@ jobs: with: gpg-fingerprint: ${{ inputs.gpg-fingerprint }} upload-url: ${{ steps.draft-release.outputs.upload_url }} - asset-path: ${{ inputs.asset-path }} + asset-path: ${{ inputs.dir }}/${{ inputs.asset-path }} - name: Create signed tag if: inputs.gpg-fingerprint @@ -278,6 +287,8 @@ jobs: needs: release if: inputs.npm uses: matrix-org/matrix-js-sdk/.github/workflows/release-npm.yml@develop + with: + dir: ${{ inputs.dir }} permissions: contents: read id-token: write diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index e4936266e..9de59b236 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -1,6 +1,11 @@ name: Publish to npm on: workflow_call: + inputs: + dir: + description: The directory to release + type: string + default: "." outputs: id: description: "The npm package@version string we published" @@ -27,7 +32,7 @@ jobs: with: cache: "pnpm" registry-url: "https://registry.npmjs.org" - node-version-file: package.json + node-version-file: ${{ inputs.dir }}/package.json # Ensure npm 11.5.1 or later is installed - name: Update npm @@ -38,6 +43,7 @@ jobs: - name: 🚀 Publish to npm id: npm-publish + working-directory: ${{ inputs.dir }} run: | npm publish --provenance --access public --tag "$TAG" release=$(jq -r '"\(.name)@\(.version)"' package.json) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1092492c..c27241f80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,8 +41,9 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - repo: - - element-hq/element-web + include: + - repo: element-hq/element-web + path: apps/web steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: @@ -59,11 +60,12 @@ jobs: - name: Bump dependency env: DEPENDENCY: ${{ needs.release.outputs.npm-id }} + DIR: ${{ matrix.path }} run: | git config --global user.email "releases@riot.im" git config --global user.name "RiotRobot" - pnpm add "$DEPENDENCY" --save-exact - git add package.json pnpm-lock.yaml + pnpm add -C "$DIR" "$DEPENDENCY" --save-exact + git add "$DIR"/package.json pnpm-lock.yaml git commit -am"Upgrade dependency to $DEPENDENCY" git push origin staging