Skip to content

Commit

Permalink
bump to latest Node version
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Nov 15, 2023
1 parent 7c197f7 commit 939e28b
Show file tree
Hide file tree
Showing 24 changed files with 18,871 additions and 24,645 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
15 changes: 0 additions & 15 deletions .github/workflows/auto-merge.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
6 changes: 6 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: Dependabot auto-merge
on: pull_request_target

jobs:
dependabot:
uses: adoptium/.github/.github/workflows/dependabot-auto-merge.yml@main
45 changes: 31 additions & 14 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,44 @@ on:
push:
branches: [ master ]
jobs:
build-and-deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '14'

- name: Install Gatsby CLI
run: npm install -g gatsby-cli
node-version: '20'

- name: Build
run: |
npm install
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
# Package the artefacts using actions/upload-pages-artifact
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
9 changes: 3 additions & 6 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '14'

- name: Install Gatsby CLI
run: npm install -g gatsby-cli
node-version: '20'

- name: Lint
run: |
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/unstage.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ This is the source of the [AdoptOpenJDK blog](https://blog.adoptopenjdk.net/).

## Prerequisites

1. Install gatsby, run `npm install -g gatsby-cli`
2. Install dependencies, run `npm install` in the root directory of the repository.
1. Install dependencies, run `npm install` in the root directory of the repository.

## Adding Content

Expand Down
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
[ "@babel/preset-env", { "targets": { "node": true } } ],
[ "@babel/preset-react" ]
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,27 @@ In order to work around this, we have had to enable hardened runtime on our bina

This requires us to add --options runtime to the codesign command. It also requires us to enable the following entitlements:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
```xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
```

### Why can’t I bundle OpenJDK8?

If you try and bundle our OpenJDK8 binaries you will receive the following notarization failure:

"message": "The binary uses an SDK older than the 10.9 SDK.",
```output
"message": "The binary uses an SDK older than the 10.9 SDK.",
```

This is because OpenJDK8 is designed to be built on a much older toolchain. We will work closely with the wider community to get a fix that allows OpenJDK8 to be built on a newer version of Xcode. As soon as this is ready we will be able to build an OpenJDK8 hardened runtime enabled binary.
2 changes: 1 addition & 1 deletion content/blog/openj9-builds-available-here/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
- openj9
---

What a crazy last week it has been for everyone at AdoptOpenJDK. We are very excited to have begun adding OpenJ9 builds to our website! The interest has been overwhelming and it was incredible to see our website reach well over 250,000 hits after a small thread on Reddit quickly became much more!<!-- excerpt-end --> The picture below from our Cloudflare analytics tool shows very clearly when the post was added to Reddit and the views kept pouring in for the rest of the day.
What a crazy last week it has been for everyone at AdoptOpenJDK. We are very excited to have begun adding OpenJ9 builds to our website! The interest has been overwhelming and it was incredible to see our website reach well over 250,000 hits after a small thread on Reddit quickly became much more! The picture below from our Cloudflare analytics tool shows very clearly when the post was added to Reddit and the views kept pouring in for the rest of the day.

![Cloudflare traffic stats](./traffic_stats.png)
*Cloudflare traffic stats*
Expand Down
2 changes: 1 addition & 1 deletion content/blog/why-github-releases/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Why GitHub Releases?
date: 2017-08-04T15:45:21+00:00
date: "2017-08-04T15:45:21+00:00"
author: georgeadams
description: "There are many advantages for us to using GitHub Releases for AdoptOpenJDK."
tags:
Expand Down
4 changes: 2 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
},
},
{
resolve: "gatsby-plugin-feed-mdx",
resolve: "gatsby-plugin-feed",
options: {
query: `
{
Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = {
query: `
{
allMdx(
sort: { order: DESC, fields: [frontmatter___date] },
sort: {frontmatter: {date: DESC}},
limit: 10
) {
edges {
Expand Down
72 changes: 58 additions & 14 deletions gatsby-node.js → gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
const path = require("path");
const fs = require("fs");
const fetch = require("node-fetch");
import path from 'path'
import fetch from 'node-fetch'
import fs from 'fs'

import { pipeline } from 'stream'
import { promisify } from 'util'
import { createFilePath } from 'gatsby-source-filesystem'

import type { GatsbyNode, Node } from 'gatsby'

interface MdxNode extends Node {
frontmatter: {
date: string;
};
fields: {
slug: string;
gitSHA?: string;
}
}

const { pipeline } = require("stream");
const { promisify } = require("util");
const { createFilePath } = require("gatsby-source-filesystem");
export const createPages: GatsbyNode['createPages'] = async ({ graphql, actions }) => {

exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions;

const authorJson = require("./content/authors.json");
Expand Down Expand Up @@ -37,10 +50,33 @@ exports.createPages = async ({ graphql, actions }) => {

const tagTemplate = path.resolve("./src/templates/tag-page.js");
const blogPost = path.resolve("./src/templates/blog-post.js");
const result = await graphql(
const result = await graphql<{
allMdx: {
edges: Array<{
node: {
fields: {
slug: string;
postPath: string;
};
frontmatter: {
title: string;
tags: string[];
};
internal: {
contentFilePath: string;
};
};
}>;
};
tagsGroup: {
group: Array<{
fieldValue: string;
}>;
};
}>(
`
{
allMdx(sort: { fields: [frontmatter___date], order: DESC }) {
allMdx(sort: {frontmatter: {date: DESC}}) {
edges {
node {
fields {
Expand All @@ -51,22 +87,29 @@ exports.createPages = async ({ graphql, actions }) => {
title
tags
}
internal {
contentFilePath
}
}
}
}
tagsGroup: allMdx(limit: 2000) {
group(field: frontmatter___tags) {
group(field: {frontmatter: {tags: SELECT}}) {
fieldValue
}
}
}
`
);
)

if (result.errors) {
throw result.errors;
}

if (!result.data) {
throw new Error("Error retrieving blog posts");
}

const posts = result.data.allMdx.edges;

posts.forEach((post, index) => {
Expand All @@ -75,7 +118,7 @@ exports.createPages = async ({ graphql, actions }) => {

createPage({
path: `${post.node.fields.postPath}`,
component: blogPost,
component: `${blogPost}?__contentFilePath=${post.node.internal.contentFilePath}`,
context: {
slug: post.node.fields.slug,
postPath: post.node.fields.postPath,
Expand Down Expand Up @@ -123,12 +166,13 @@ exports.createPages = async ({ graphql, actions }) => {
});
};

exports.onCreateNode = ({ node, actions, getNode }) => {
export const onCreateNode: GatsbyNode['onCreateNode'] = async ({ node, actions, getNode }) => {
const { createNodeField } = actions;

if (node.internal.type === "Mdx") {
const slug = createFilePath({ node, getNode });
const date = new Date(node.frontmatter.date);
const mdxNode = node as MdxNode
const date = new Date(mdxNode.frontmatter.date);
const year = date.getFullYear();
const zeroPaddedMonth = `${date.getMonth() + 1}`.padStart(2, "0");

Expand Down
Loading

0 comments on commit 939e28b

Please sign in to comment.