Skip to content

Commit

Permalink
CI: Fix publishing to GitHub packages (#27827)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexslavr authored Jul 29, 2024
1 parent 0da92cc commit 62a9727
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/packages_publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm set //npm.pkg.github.com/:_authToken="$NODE_AUTH_TOKEN";
pnpm publish --quiet --ignore-scripts --registry https://npm.pkg.github.com;
pnpm publish --no-git-checks --quiet --ignore-scripts --registry https://npm.pkg.github.com;
- name: Move 'daily' tag
if: ${{ env.MOVE_DAILY_TAG == 'true' }}
Expand All @@ -185,7 +185,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm set //npm.pkg.github.com/:_authToken="$NODE_AUTH_TOKEN"
pnpm --registry=https://npm.pkg.github.com dist-tag add $PACKAGE_NAME@$PACKAGE_VERSION $PACKAGE_VERSION_MAJOR-daily
pnpm dist-tag add $PACKAGE_NAME@$PACKAGE_VERSION $PACKAGE_VERSION_MAJOR-daily --registry=https://npm.pkg.github.com
- name: Move 'stable' tag
if: ${{ env.MOVE_STABLE_TAG == 'true' }}
Expand All @@ -196,7 +196,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm set //npm.pkg.github.com/:_authToken="$NODE_AUTH_TOKEN"
pnpm --registry=https://npm.pkg.github.com dist-tag add $PACKAGE_NAME@$PACKAGE_VERSION $PACKAGE_VERSION_MAJOR-stable
pnpm dist-tag add $PACKAGE_NAME@$PACKAGE_VERSION $PACKAGE_VERSION_MAJOR-stable --registry=https://npm.pkg.github.com
notify:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wrapper_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
test:
runs-on: devextreme-shr2
timeout-minutes: 30
timeout-minutes: 40

steps:
- name: Get sources
Expand Down
11 changes: 10 additions & 1 deletion packages/devextreme-angular/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,20 @@ gulp.task('npm.content', gulp.series(

return gulp.src([`${cmpConfig.outputPath}/**/collection.json`, ...npmConfig.content])
.pipe(gulp.dest(npmConfig.distPath));
},
}
));

gulp.task('npm.package-json', (cb) => {
const pkgPath = path.join('.', buildConfig.npm.distPath, 'package.json');
const pkg = require(`./${pkgPath}`);
delete pkg.publishConfig;
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2))
cb();
})

gulp.task('npm.pack', gulp.series(
'npm.content',
'npm.package-json',
(cb) => {
argv.withDescriptions ? exec('pnpm run angular:inject-descriptions', { cwd: '../..' }, (err) => cb(err)) : cb();
},
Expand Down
14 changes: 8 additions & 6 deletions packages/devextreme-react/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const header = require('gulp-header');
const ts = require('gulp-typescript');
const config = require('./build.config');
const path = require('path');
const pkg = require('./package.json');
const generateReactComponents = require('devextreme-internal-tools').generateReactComponents;

const GENERATE = 'generate';
Expand Down Expand Up @@ -58,9 +57,12 @@ gulp.task(NPM_CLEAN, (c) =>
del(config.npm.dist, c)
);

gulp.task(NPM_PACKAGE, gulp.series(
() => gulp.src(config.npm.package).pipe(gulp.dest(config.npm.dist))
));
gulp.task(NPM_PACKAGE, (done) => {
const pkg = require('./package.json');
delete pkg.publishConfig;
fs.writeFileSync(path.join(config.npm.dist, 'package.json'), JSON.stringify(pkg, null, 2))
done();
});

gulp.task(NPM_LICENSE, gulp.series(
() => gulp.src(config.npm.license).pipe(gulp.dest(config.npm.dist))
Expand Down Expand Up @@ -120,11 +122,11 @@ gulp.task(NPM_BUILD, gulp.series(
NPM_CLEAN,
gulp.parallel(
NPM_LICENSE,
NPM_PACKAGE,
NPM_README,
NPM_BUILD_ESM,
NPM_BUILD_CJS
)
),
NPM_PACKAGE
));

gulp.task(NPM_BUILD_WITH_HEADERS, gulp.series(
Expand Down
13 changes: 8 additions & 5 deletions packages/devextreme-vue/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ gulp.task(GENERATE,
}
);

gulp.task(NPM_PACKAGE,
() => gulp.src(config.npm.package).pipe(gulp.dest(config.npm.dist))
);
gulp.task(NPM_PACKAGE, (done) => {
const pkg = require('./package.json');
delete pkg.publishConfig;
fs.writeFileSync(path.join(config.npm.dist, 'package.json'), JSON.stringify(pkg, null, 2))
done();
});

gulp.task(NPM_LICENSE,
() => gulp.src(config.npm.license).pipe(gulp.dest(config.npm.dist))
Expand Down Expand Up @@ -89,11 +92,11 @@ gulp.task(
gulp.series(
gulp.parallel(
NPM_LICENSE,
NPM_PACKAGE,
NPM_README,
NPM_BUILD_ESM,
NPM_BUILD_CJS
)
),
NPM_PACKAGE
)
);

Expand Down

0 comments on commit 62a9727

Please sign in to comment.