From 26b729922fcdd5e189b8d09db91da568ca5bab43 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 10 Jun 2024 10:56:26 +0200 Subject: [PATCH 01/14] chore: first attempt at copy to d2-ci --- .github/workflows/copy-build-to-d2-ci.yml | 83 +++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/copy-build-to-d2-ci.yml diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml new file mode 100644 index 000000000..808edf0c8 --- /dev/null +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -0,0 +1,83 @@ +name: Publish JavaScript Library + +on: + push: + branches-ignore: + - master + release: + types: [published] + +env: + GIT_AUTHOR_NAME: '@dhis2-bot' + GIT_AUTHOR_EMAIL: 'apps@dhis2.org' + GIT_COMMITTER_NAME: '@dhis2-bot' + GIT_COMMITTER_EMAIL: 'apps@dhis2.org' + NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}} + GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} + +jobs: + publish-to-github: + runs-on: ubuntu-latest + if: contains(github.ref, 'alpha') + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + token: ${{env.GH_TOKEN}} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install --frozen-lockfile + + - name: Build package + run: yarn build + + - name: Pack and unpack the build + run: yarn pack --filename output.tgz && tar -xzf output.tgz + + - name: Copy package to d2-ci + uses: dhis2/deploy-build@master + with: + github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} + + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/ + + + + + + + + + + + publish-to-npm: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build package + run: npm run build + + - name: Publish to npm + run: npm publish --registry=https://registry.npmjs.org + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 4e8aa14fe1502375014b8f90edfb7c134a3be8e8 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 10 Jun 2024 11:14:28 +0200 Subject: [PATCH 02/14] chore: remove unneeded lines and lint --- .github/workflows/copy-build-to-d2-ci.yml | 113 +++++++--------------- 1 file changed, 36 insertions(+), 77 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 808edf0c8..13bc2d8bb 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -1,83 +1,42 @@ -name: Publish JavaScript Library +name: Copy build to d2-ci on: - push: - branches-ignore: - - master - release: - types: [published] + push: + branches-ignore: + - master env: - GIT_AUTHOR_NAME: '@dhis2-bot' - GIT_AUTHOR_EMAIL: 'apps@dhis2.org' - GIT_COMMITTER_NAME: '@dhis2-bot' - GIT_COMMITTER_EMAIL: 'apps@dhis2.org' - NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}} - GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} + GIT_AUTHOR_NAME: '@dhis2-bot' + GIT_AUTHOR_EMAIL: 'apps@dhis2.org' + GIT_COMMITTER_NAME: '@dhis2-bot' + GIT_COMMITTER_EMAIL: 'apps@dhis2.org' + NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}} + GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} jobs: - publish-to-github: - runs-on: ubuntu-latest - if: contains(github.ref, 'alpha') - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - token: ${{env.GH_TOKEN}} - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies - run: npm install --frozen-lockfile - - - name: Build package - run: yarn build - - - name: Pack and unpack the build - run: yarn pack --filename output.tgz && tar -xzf output.tgz - - - name: Copy package to d2-ci - uses: dhis2/deploy-build@master - with: - github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} - - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/ - - - - - - - - - - - publish-to-npm: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies - run: npm install - - - name: Build package - run: npm run build - - - name: Publish to npm - run: npm publish --registry=https://registry.npmjs.org - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + copy-to-d2-ci: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + token: ${{env.GH_TOKEN}} + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install --frozen-lockfile + + - name: Build package + run: yarn build + + - name: Pack and unpack the build + run: yarn pack --filename output.tgz && tar -xzf output.tgz + + - name: Copy package to d2-ci + uses: dhis2/deploy-build@master + with: + github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} From a3b0a6a8354c556cc6c617a5b09025ea18771bf4 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 10 Jun 2024 11:23:30 +0200 Subject: [PATCH 03/14] chore: use older node --- .github/workflows/copy-build-to-d2-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 13bc2d8bb..dfc6bdf02 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -16,6 +16,7 @@ env: jobs: copy-to-d2-ci: runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout code uses: actions/checkout@v3 @@ -23,12 +24,12 @@ jobs: token: ${{env.GH_TOKEN}} - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v1 with: - node-version: '18' + node-version: '16.x' - name: Install dependencies - run: npm install --frozen-lockfile + run: yarn install --frozen-lockfile - name: Build package run: yarn build From 6cde8b84b02f84c3a25fe8a777108e831fc0126e Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 10 Jun 2024 11:37:53 +0200 Subject: [PATCH 04/14] chore: make some changes to test the build --- src/components/AboutAOUnit/AboutAOUnit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/AboutAOUnit/AboutAOUnit.js b/src/components/AboutAOUnit/AboutAOUnit.js index 1e2d77ab1..ae103dd46 100644 --- a/src/components/AboutAOUnit/AboutAOUnit.js +++ b/src/components/AboutAOUnit/AboutAOUnit.js @@ -65,6 +65,8 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => { const queries = useMemo(() => getQueries(type), [type]) + console.log('testing build from d2-ci') + const { data, loading: dataIsLoading, @@ -212,7 +214,7 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => {

- {i18n.t('Last updated {{time}}', { + {i18n.t('Testing testing {{time}}', { time: moment( fromServerDate(data.ao.lastUpdated) ).fromNow(), From 7637e442e306eeb5393ec33ba5b6783944c8575c Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 10 Jun 2024 13:22:15 +0200 Subject: [PATCH 05/14] chore: set build dir --- .github/workflows/copy-build-to-d2-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index dfc6bdf02..679cf5cc6 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -16,7 +16,6 @@ env: jobs: copy-to-d2-ci: runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout code uses: actions/checkout@v3 @@ -40,4 +39,5 @@ jobs: - name: Copy package to d2-ci uses: dhis2/deploy-build@master with: + build-dir: build github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} From 4e67eeb98387947cf3886857a79ac18894fadc63 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 10:17:06 +0200 Subject: [PATCH 06/14] chore: set the build-dir to package --- .github/workflows/copy-build-to-d2-ci.yml | 2 +- src/components/AboutAOUnit/AboutAOUnit.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 679cf5cc6..97485418a 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -39,5 +39,5 @@ jobs: - name: Copy package to d2-ci uses: dhis2/deploy-build@master with: - build-dir: build + build-dir: package github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} diff --git a/src/components/AboutAOUnit/AboutAOUnit.js b/src/components/AboutAOUnit/AboutAOUnit.js index ae103dd46..ff2702358 100644 --- a/src/components/AboutAOUnit/AboutAOUnit.js +++ b/src/components/AboutAOUnit/AboutAOUnit.js @@ -65,7 +65,7 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => { const queries = useMemo(() => getQueries(type), [type]) - console.log('testing build from d2-ci') + console.log('testing build from d2-ci 2') const { data, From 60146006391b7f97f7940510dff3f699a32323b4 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 10:53:01 +0200 Subject: [PATCH 07/14] chore: add comment explaining folder name --- .github/workflows/copy-build-to-d2-ci.yml | 2 +- src/components/AboutAOUnit/AboutAOUnit.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 97485418a..9c1619560 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -33,7 +33,7 @@ jobs: - name: Build package run: yarn build - - name: Pack and unpack the build + - name: Pack and unpack the build to a directory named 'package' run: yarn pack --filename output.tgz && tar -xzf output.tgz - name: Copy package to d2-ci diff --git a/src/components/AboutAOUnit/AboutAOUnit.js b/src/components/AboutAOUnit/AboutAOUnit.js index ff2702358..dcceceb2e 100644 --- a/src/components/AboutAOUnit/AboutAOUnit.js +++ b/src/components/AboutAOUnit/AboutAOUnit.js @@ -65,7 +65,7 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => { const queries = useMemo(() => getQueries(type), [type]) - console.log('testing build from d2-ci 2') + console.log('testing build from d2-ci 3') const { data, From 607e61dbc3529eec4476bb3664db57ddd7001ea4 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 11:11:27 +0200 Subject: [PATCH 08/14] chore: update readme and ignore all prod branches --- .github/workflows/copy-build-to-d2-ci.yml | 7 ++++ README.md | 45 ++++++++++++++--------- src/components/AboutAOUnit/AboutAOUnit.js | 4 +- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 9c1619560..8ff14fb62 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -4,6 +4,13 @@ on: push: branches-ignore: - master + - next + - next-major + - alpha + - beta + - '[0-9]+.x' + - '[0-9]+.x.x' + - '[0-9]+.[0-9]+.x' env: GIT_AUTHOR_NAME: '@dhis2-bot' diff --git a/README.md b/README.md index 765527a1a..42ae8f989 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,9 @@ **master** [![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) -**21.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=21.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=21.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) +**24.x** +[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=24.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=24.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) -**20.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=20.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=20.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) - -**16.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=16.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=16.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) - -**11.0.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=11.0.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=11.0.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) - -**4.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=4.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=4.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) - -**2.4.x** -[![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=2.4.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=2.4.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) ## Overview @@ -28,6 +14,7 @@ The analytics library contains components and modules that are used in DHIS 2 an - [dhis2/dashboards-app](https://github.com/dhis2/dashboards-app) - [dhis2/data-visualizer-app](https://github.com/dhis2/data-visualizer-app) - [dhis2/maps-app](https://github.com/dhis2/maps-app) +- [dhis2/line-listing-app](https://github.com/dhis2/line-listing-app) [Module layout documentation](./docs/module-layout.md) @@ -35,7 +22,7 @@ The analytics library contains components and modules that are used in DHIS 2 an The analytics package is published to npm as @dhis2/analytics. -To publish, simply mark the commit using [semantic release terminology](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) (see notes below for branch-specific restrictions). Once committed, github actions will take care of publishing the new version to npm. +To publish, mark the commit using [semantic release terminology](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) (see notes below for branch-specific restrictions). Once committed, github actions will take care of publishing the new version to npm. ### master branch @@ -43,7 +30,29 @@ The master branch follows semantic versioning according to spec. ### .x branches -Commits to .x branches (e.g. 16.x) cannot trigger a major version bump, even if it is technically a breaking change. This is because the next version has already been published. Additionally, branches that use .x for the patch version (e.g. 11.0.x, 2.4.x), cannot trigger a minor version bump. In the unlikely case that you need to commit a change that would trigger a version bump that's not possible, you will have to mark it to only trigger a patch or minor bump respectively, then make sure to update the apps that are locked to the .x version of analytics +Commits to .x branches (e.g. 24.x) cannot trigger a major version bump, even if it is technically a breaking change. This is because the next version has already been published. Additionally, branches that use .x for the patch version (e.g. 11.0.x, 2.4.x), cannot trigger a minor version bump. In the unlikely case that you need to commit a change that would trigger a version bump that's not possible, you will have to mark it to only trigger a patch or minor bump respectively, then make sure to update the apps that are locked to the .x version of analytics + +## Publishing pre-release versions during app development + +Builds for all non-production branches are automatically copied to [d2-ci/analytics](https://github.com/d2-ci/analytics) for use during development and testing, prior to production release. + +To test changes in a development branch, change the analytics dependency of package.json of the app you are testing with. There are a few options: + +1. point to a specific commit: +``` +"dependencies": { + "@dhis2/analytics": "git+https://github.com/d2-ci/analytics.git#70249ebe8be39051fa10142f850de449e1ec488c", + ... +} +``` + +2. point to a branch: +``` +"dependencies": { + "@dhis2/analytics": "git+https://github.com/d2-ci/analytics.git#chore/some-chore", + ... +} +``` ## Report an issue diff --git a/src/components/AboutAOUnit/AboutAOUnit.js b/src/components/AboutAOUnit/AboutAOUnit.js index dcceceb2e..1e2d77ab1 100644 --- a/src/components/AboutAOUnit/AboutAOUnit.js +++ b/src/components/AboutAOUnit/AboutAOUnit.js @@ -65,8 +65,6 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => { const queries = useMemo(() => getQueries(type), [type]) - console.log('testing build from d2-ci 3') - const { data, loading: dataIsLoading, @@ -214,7 +212,7 @@ const AboutAOUnit = forwardRef(({ type, id, renderId }, ref) => {

- {i18n.t('Testing testing {{time}}', { + {i18n.t('Last updated {{time}}', { time: moment( fromServerDate(data.ao.lastUpdated) ).fromNow(), From 0b20b5714ebc67037746a5db6244b4cc5440af02 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 11:25:36 +0200 Subject: [PATCH 09/14] chore: lint --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42ae8f989..e39d92a55 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ **24.x** [![Test](https://github.com/dhis2/analytics/actions/workflows/node-test.yml/badge.svg?branch=24.x)](https://github.com/dhis2/analytics/actions/workflows/node-test.yml) [![DHIS2: Release](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml/badge.svg?branch=24.x)](https://github.com/dhis2/analytics/actions/workflows/node-publish.yml) - ## Overview The analytics library contains components and modules that are used in DHIS 2 analytics apps, including: @@ -36,9 +35,10 @@ Commits to .x branches (e.g. 24.x) cannot trigger a major version bump, even if Builds for all non-production branches are automatically copied to [d2-ci/analytics](https://github.com/d2-ci/analytics) for use during development and testing, prior to production release. -To test changes in a development branch, change the analytics dependency of package.json of the app you are testing with. There are a few options: +To test changes in a development branch, change the analytics dependency of package.json of the app you are testing with. There are a few options: 1. point to a specific commit: + ``` "dependencies": { "@dhis2/analytics": "git+https://github.com/d2-ci/analytics.git#70249ebe8be39051fa10142f850de449e1ec488c", @@ -47,6 +47,7 @@ To test changes in a development branch, change the analytics dependency of pack ``` 2. point to a branch: + ``` "dependencies": { "@dhis2/analytics": "git+https://github.com/d2-ci/analytics.git#chore/some-chore", From 346608bfa49e690575d68199cb19783d39ede5eb Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 11:34:47 +0200 Subject: [PATCH 10/14] chore: maybe we dont need all these env vars --- .github/workflows/copy-build-to-d2-ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 8ff14fb62..0681e7e91 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -13,11 +13,6 @@ on: - '[0-9]+.[0-9]+.x' env: - GIT_AUTHOR_NAME: '@dhis2-bot' - GIT_AUTHOR_EMAIL: 'apps@dhis2.org' - GIT_COMMITTER_NAME: '@dhis2-bot' - GIT_COMMITTER_EMAIL: 'apps@dhis2.org' - NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}} GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} jobs: @@ -47,4 +42,4 @@ jobs: uses: dhis2/deploy-build@master with: build-dir: package - github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} + github-token: ${{env.GH_TOKEN}} From 000ec167a93a0197c021a40251a75c3ddd59c61e Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 13:06:19 +0200 Subject: [PATCH 11/14] chore: try uploading artifact to current repo --- .github/workflows/copy-build-to-d2-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 0681e7e91..3e9aa7852 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -35,6 +35,14 @@ jobs: - name: Build package run: yarn build + - uses: actions/upload-artifact@v2 + with: + name: lib-build + path: | + **/build + !**/node_modules + retention-days: 2 + - name: Pack and unpack the build to a directory named 'package' run: yarn pack --filename output.tgz && tar -xzf output.tgz From 183c4c948a88abe44d8eb1c08d33522a360585c2 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 13:20:09 +0200 Subject: [PATCH 12/14] chore: upload yarn pack result --- .github/workflows/copy-build-to-d2-ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 3e9aa7852..7df7f7463 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -35,17 +35,15 @@ jobs: - name: Build package run: yarn build + - name: Pack and unpack the build to a directory named 'package' + run: yarn pack --filename output.tgz && tar -xzf output.tgz + - uses: actions/upload-artifact@v2 with: - name: lib-build - path: | - **/build - !**/node_modules + name: output-build + path: output.tgz retention-days: 2 - - name: Pack and unpack the build to a directory named 'package' - run: yarn pack --filename output.tgz && tar -xzf output.tgz - - name: Copy package to d2-ci uses: dhis2/deploy-build@master with: From 1525db4602052ef3c46cf01a33441cb0a8992f54 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 14:16:38 +0200 Subject: [PATCH 13/14] Revert "chore: upload yarn pack result" This reverts commit 183c4c948a88abe44d8eb1c08d33522a360585c2. --- .github/workflows/copy-build-to-d2-ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 7df7f7463..3e9aa7852 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -35,15 +35,17 @@ jobs: - name: Build package run: yarn build - - name: Pack and unpack the build to a directory named 'package' - run: yarn pack --filename output.tgz && tar -xzf output.tgz - - uses: actions/upload-artifact@v2 with: - name: output-build - path: output.tgz + name: lib-build + path: | + **/build + !**/node_modules retention-days: 2 + - name: Pack and unpack the build to a directory named 'package' + run: yarn pack --filename output.tgz && tar -xzf output.tgz + - name: Copy package to d2-ci uses: dhis2/deploy-build@master with: From 4bf9287ea669233463a7ff8f4de2c449f4809f55 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 11 Jun 2024 14:16:50 +0200 Subject: [PATCH 14/14] Revert "chore: try uploading artifact to current repo" This reverts commit 000ec167a93a0197c021a40251a75c3ddd59c61e. --- .github/workflows/copy-build-to-d2-ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/copy-build-to-d2-ci.yml b/.github/workflows/copy-build-to-d2-ci.yml index 3e9aa7852..0681e7e91 100644 --- a/.github/workflows/copy-build-to-d2-ci.yml +++ b/.github/workflows/copy-build-to-d2-ci.yml @@ -35,14 +35,6 @@ jobs: - name: Build package run: yarn build - - uses: actions/upload-artifact@v2 - with: - name: lib-build - path: | - **/build - !**/node_modules - retention-days: 2 - - name: Pack and unpack the build to a directory named 'package' run: yarn pack --filename output.tgz && tar -xzf output.tgz