mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-09-23 21:02:58 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8755e624b | ||
|
|
c53e8f0d96 | ||
|
|
c582c0a764 | ||
|
|
1574db77a9 | ||
|
|
940247d08e | ||
|
|
d17f2aa363 | ||
|
|
c4a9c2db41 | ||
|
|
89ca553e6c | ||
|
|
18deeac04c | ||
|
|
7845c37f7f | ||
|
|
8d04cd0510 | ||
|
|
9c46f58a58 | ||
|
|
1f043ee545 | ||
|
|
412dd9124a | ||
|
|
4a3d6e00a5 | ||
|
|
2752ce1d29 | ||
|
|
d8391e68b0 | ||
|
|
4e5bf412f0 | ||
|
|
c2f9fa4376 |
@@ -14,15 +14,15 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
security-events: write
|
security-events: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
|
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
|
||||||
with:
|
with:
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
|
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
|
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
|
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
- run: make build
|
- run: make build
|
||||||
- run: make cirun cmd="npm ci"
|
- run: make cirun cmd="npm ci"
|
||||||
# - run: make ciall
|
# - run: make ciall
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ jobs:
|
|||||||
hugo-version: ['latest', '0.160.1']
|
hugo-version: ['latest', '0.160.1']
|
||||||
extended: [true, false]
|
extended: [true, false]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@32c7754570a8edd0ae33352fae4a8448f23858e9 # v3.1.0
|
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
|
||||||
with:
|
with:
|
||||||
hugo-version: ${{ matrix.hugo-version }}
|
hugo-version: ${{ matrix.hugo-version }}
|
||||||
extended: ${{ matrix.extended }}
|
extended: ${{ matrix.extended }}
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ jobs:
|
|||||||
- 'macos-latest'
|
- 'macos-latest'
|
||||||
- 'windows-latest'
|
- 'windows-latest'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
@@ -53,4 +53,4 @@ jobs:
|
|||||||
name: coverage-${{ matrix.os }}
|
name: coverage-${{ matrix.os }}
|
||||||
path: coverage
|
path: coverage
|
||||||
|
|
||||||
- uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
|
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- name: Update major tag
|
- name: Update major tag
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [3.2.1](https://github.com/peaceiris/actions-hugo/compare/v3.2.0...v3.2.1) (2026-05-10)
|
||||||
|
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* handle Hugo 0.139.5 archive fallback (#696) ([4e5bf41](https://github.com/peaceiris/actions-hugo/commit/4e5bf412f00ba628ed366436825de7226933f80d)), closes [#696](https://github.com/peaceiris/actions-hugo/issues/696)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [3.2.0](https://github.com/peaceiris/actions-hugo/compare/v3.1.0...v3.2.0) (2026-05-10)
|
# [3.2.0](https://github.com/peaceiris/actions-hugo/compare/v3.1.0...v3.2.0) (2026-05-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import getURL from '../src/get-url';
|
import getURL, {getDownloadVersion} from '../src/get-url';
|
||||||
|
|
||||||
describe('getURL()', () => {
|
describe('getURL()', () => {
|
||||||
test('get URLs to Linux assets', () => {
|
test('get URLs to Linux assets', () => {
|
||||||
@@ -139,6 +139,19 @@ describe('getURL()', () => {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('get URLs to Hugo 0.139.5 archive alias', () => {
|
||||||
|
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.139.4';
|
||||||
|
expect(getDownloadVersion('0.139.5')).toBe('0.139.4');
|
||||||
|
expect(getURL('linux', 'amd64', 'true', '0.139.5')).toEqual([
|
||||||
|
`${baseURL}/hugo_extended_0.139.4_linux-amd64.tar.gz`,
|
||||||
|
`${baseURL}/hugo_extended_0.139.4_Linux-amd64.tar.gz`,
|
||||||
|
`${baseURL}/hugo_extended_0.139.4_Linux_amd64.tar.gz`,
|
||||||
|
`${baseURL}/hugo_extended_v0.139.4_linux-amd64.tar.gz`,
|
||||||
|
`${baseURL}/hugo_extended_v0.139.4_Linux-amd64.tar.gz`,
|
||||||
|
`${baseURL}/hugo_extended_v0.139.4_Linux_amd64.tar.gz`
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
test('get a fallback URL to an unknown OS asset', () => {
|
test('get a fallback URL to an unknown OS asset', () => {
|
||||||
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.58.2';
|
const baseURL = 'https://github.com/gohugoio/hugo/releases/download/v0.58.2';
|
||||||
expect(getURL('MyOS', '64bit', 'false', '0.58.2')).toEqual([
|
expect(getURL('MyOS', '64bit', 'false', '0.58.2')).toEqual([
|
||||||
|
|||||||
-42519
File diff suppressed because one or more lines are too long
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-hugo",
|
"name": "actions-hugo",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "actions-hugo",
|
"name": "actions-hugo",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-hugo",
|
"name": "actions-hugo",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"description": "GitHub Actions for Hugo",
|
"description": "GitHub Actions for Hugo",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
+14
-3
@@ -4,6 +4,8 @@ export default function getURL(
|
|||||||
extended: string,
|
extended: string,
|
||||||
version: string
|
version: string
|
||||||
): string[] {
|
): string[] {
|
||||||
|
const downloadVersion = getDownloadVersion(version);
|
||||||
|
|
||||||
const extendedStr = (extended: string): string => {
|
const extendedStr = (extended: string): string => {
|
||||||
if (extended === 'true') {
|
if (extended === 'true') {
|
||||||
return 'extended_';
|
return 'extended_';
|
||||||
@@ -28,12 +30,12 @@ export default function getURL(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const baseURL = 'https://github.com/gohugoio/hugo/releases/download';
|
const baseURL = 'https://github.com/gohugoio/hugo/releases/download';
|
||||||
const assetBase = `hugo_${extendedStr(extended)}${version}_`;
|
const assetBase = `hugo_${extendedStr(extended)}${downloadVersion}_`;
|
||||||
const legacyVersionedAssetBase = `hugo_${extendedStr(extended)}v${version}_`;
|
const legacyVersionedAssetBase = `hugo_${extendedStr(extended)}v${downloadVersion}_`;
|
||||||
const assetBases = [assetBase, legacyVersionedAssetBase];
|
const assetBases = [assetBase, legacyVersionedAssetBase];
|
||||||
const assetURLs = (assetNames: string[]): string[] => {
|
const assetURLs = (assetNames: string[]): string[] => {
|
||||||
return Array.from(new Set(assetNames)).map(assetName => {
|
return Array.from(new Set(assetNames)).map(assetName => {
|
||||||
return `${baseURL}/v${version}/${assetName}`;
|
return `${baseURL}/v${downloadVersion}/${assetName}`;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,3 +84,12 @@ export default function getURL(
|
|||||||
|
|
||||||
return assetURLs([`${assetBase}${os}-${arch}.tar.gz`]);
|
return assetURLs([`${assetBase}${os}-${arch}.tar.gz`]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDownloadVersion(version: string): string {
|
||||||
|
if (version === '0.139.5') {
|
||||||
|
// v0.139.5 has no release archives; Hugo publishes the same archives under v0.139.4.
|
||||||
|
return '0.139.4';
|
||||||
|
}
|
||||||
|
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|||||||
+7
-1
@@ -5,7 +5,7 @@ import * as exec from '@actions/exec';
|
|||||||
import {getConventions} from './get-conventions';
|
import {getConventions} from './get-conventions';
|
||||||
import getOS from './get-os';
|
import getOS from './get-os';
|
||||||
import getArch from './get-arch';
|
import getArch from './get-arch';
|
||||||
import getURL from './get-url';
|
import getURL, {getDownloadVersion} from './get-url';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {Tool, Action} from './constants';
|
import {Tool, Action} from './constants';
|
||||||
|
|
||||||
@@ -123,6 +123,12 @@ export async function installer(version: string): Promise<void> {
|
|||||||
core.debug(`Processor Architecture: ${archName}`);
|
core.debug(`Processor Architecture: ${archName}`);
|
||||||
|
|
||||||
const toolURLs: string[] = getURL(osName, archName, extended, version);
|
const toolURLs: string[] = getURL(osName, archName, extended, version);
|
||||||
|
const downloadVersion = getDownloadVersion(version);
|
||||||
|
if (downloadVersion !== version) {
|
||||||
|
core.info(
|
||||||
|
`Hugo ${version} release does not publish archives; downloading v${downloadVersion} archives instead.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const workDir = await createWorkDir();
|
const workDir = await createWorkDir();
|
||||||
const binDir = await createBinDir(workDir);
|
const binDir = await createBinDir(workDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user