Skip to content

Commit

Permalink
Rewrite to webpack and add npm release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven65 committed Sep 9, 2024
1 parent 1588c1f commit 0f2292a
Show file tree
Hide file tree
Showing 10 changed files with 6,671 additions and 6,390 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,45 @@ jobs:
uses: helsingborg-stad/[email protected]
with:
php-version: 8.2
node-version: 20.6.0
node-version: 20.6.0

build-assets:
needs: ['release']
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get latest release version
id: get-version
run: |
echo "LATEST_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://npm.pkg.github.com/'
- name: Inject access token in .npmrc
run: |
echo "registry=https://npm.pkg.github.com/helsingborg-stad" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
- name: Run CI
if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') != '' }}
run: npm ci --no-progress --no-audit
- name: Run install
if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') == '' }}
run: npm install --no-progress --no-audit
- name: Run build
if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') == '' }}
run: npx --yes browserslist@latest --update-db && npm run build
- name: Run gulp
if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') != '' }}
run: gulp
- name: Publish npm package to GHCR
run: npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# ignore all files starting with . or ~
.*
~*

# ignore node/grunt dependency directories
node_modules/

Expand Down Expand Up @@ -46,6 +42,12 @@ Thumbs.db
*.tar
*.zip


# ignore dist folder
dist/
dist


# -------------------------
# BEGIN Whitelisted Files
# -------------------------
Expand Down
51 changes: 0 additions & 51 deletions dist/css/acf-ux-collapse.dev.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/css/acf-ux-collapse.min.css

This file was deleted.

81 changes: 0 additions & 81 deletions dist/js/acf-ux-collapse.dev.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/js/acf-ux-collapse.min.js

This file was deleted.

53 changes: 0 additions & 53 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit 0f2292a

Please sign in to comment.