Skip to content

Commit 4b9be3c

Browse files
committed
Centralize version number
Reduce repetition of quick-lint-js' version number throughout the repository by referring to a central 'version' file.
1 parent 84d0c0c commit 4b9be3c

File tree

17 files changed

+128
-43
lines changed

17 files changed

+128
-43
lines changed

.github/workflows/tag-build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ jobs:
99
name: tag
1010
runs-on: ubuntu-latest
1111
container: ghcr.io/quick-lint/quick-lint-js-github-builder:v1
12-
env:
13-
QLJS_VERSION: "0.3.0"
1412
steps:
1513
- name: create tag file
1614
run: |
@@ -28,14 +26,21 @@ jobs:
2826
- name: checkout
2927
uses: actions/checkout@v2
3028

29+
- name: get version
30+
id: getversion
31+
run: printf '::set-output name=QLJS_VERSION::%s\n' "$(head -n1 version)"
32+
shell: bash
33+
3134
- name: create source archive
3235
run: git archive --format tar.gz --prefix "quick-lint-js-${QLJS_VERSION}/" --output "quick-lint-js-${QLJS_VERSION}.tar.gz" HEAD
36+
env:
37+
QLJS_VERSION: ${{ steps.getversion.outputs.QLJS_VERSION }}
3338
- name: upload source archive
3439
if: ${{ github.repository_owner == 'quick-lint' }}
3540
uses: quick-lint/sftp-upload@master
3641
with:
3742
host: ${{ secrets.artifacts_host }}
38-
local-file-globs: quick-lint-js-${{ env.QLJS_VERSION }}.tar.gz
43+
local-file-globs: quick-lint-js-${{ steps.getversion.outputs.QLJS_VERSION }}.tar.gz
3944
private-key: ${{ secrets.artifacts_key }}
4045
remote-directory: ${{ secrets.artifacts_root }}/builds/${{ github.sha }}/source/
4146
user: ${{ secrets.artifacts_user }}

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ cmake_minimum_required(VERSION 3.10)
55
if (POLICY CMP0091)
66
cmake_policy(SET CMP0091 NEW)
77
endif ()
8+
9+
file(READ version QUICK_LINT_JS_VERSION)
10+
string(REGEX MATCH "^[^\n]+" QUICK_LINT_JS_VERSION "${QUICK_LINT_JS_VERSION}")
11+
812
project(quick-lint-js)
913

1014
include(GNUInstallDirs)

Formula/quick-lint-js.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class QuickLintJs < Formula
55
desc "Find bugs in your JavaScript code"
66
homepage "https://quick-lint-js.com/"
7-
url "https://github.com/quick-lint/quick-lint-js/archive/refs/tags/0.3.0.tar.gz"
7+
url "https://github.com/quick-lint/quick-lint-js/archive/refs/tags/#{File.read("version").split[0]}.tar.gz"
88
head "https://github.com/quick-lint/quick-lint-js.git", :branch => "master"
99
license "GPL-3.0-or-later"
1010

dist/debian/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -x
99

1010
cd "$(dirname "${0}")/../.."
1111

12-
package_version=0.3.0
12+
package_version="$(head -n1 version)"
1313

1414
DEB_BUILD_OPTIONS="parallel=$(nproc)"
1515
export DEB_BUILD_OPTIONS

dist/nix/quick-lint-js.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
mkDerivation {
1515
pname = "quick-lint-js";
16-
version = "0.3.0";
16+
version = builtins.head (builtins.split "\n" (builtins.readFile ../../version));
1717

1818
src = ../../.;
1919
unpackPhase = null;

docs/RELEASE.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,19 @@ Follow the following steps to release a new version of quick-lint-js:
66

77
2. Update version number and release date. Change these files containing version
88
numbers:
9-
* .github/workflows/tag-build.yml
10-
* Formula/quick-lint-js.rb
119
* dist/arch/PKGBUILD-dev
1210
* dist/arch/PKGBUILD-git
1311
* dist/arch/PKGBUILD-release
1412
* dist/debian/README.md
15-
* dist/debian/build.sh
1613
* dist/debian/debian/changelog
17-
* dist/nix/quick-lint-js.nix
1814
* dist/npm/BUILDING.md
1915
* dist/npm/package.json
20-
* docs/cli.adoc
21-
* docs/config.adoc
2216
* plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt
2317
* plugin/vscode-lsp/README.md
2418
* plugin/vscode-lsp/package.json
2519
* plugin/vscode/BUILDING.md
2620
* plugin/vscode/package.json
27-
* src/quick-lint-js/version.h
28-
* website/public/index.ejs.html
29-
* website/public/install/index.ejs.html
21+
* version
3022

3123
3. Re-generate man pages to include the updated version number by running
3224
`./docs/man/generate-man-pages`.

docs/cli.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// See end of file for extended copyright information.
33

44
= quick-lint-js(1)
5-
:version: 0.3.0
5+
:version:  \
6+
include::../version[lines=1]
67
:mansource: quick-lint-js version {version}
78
:toc:
89
:reproducible:

docs/config.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// See end of file for extended copyright information.
33

44
= quick-lint-js.config(5)
5-
:version: 0.3.0
5+
:version:  \
6+
include::../version[lines=1]
67
:mansource: quick-lint-js version {version}
78
:toc:
89
:reproducible:

docs/man/quick-lint-js.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
.\" Author: [see the "AUTHOR(S)" section]
1111
.\" Generator: Asciidoctor 2.0.15
1212
.\" Manual: \ \&
13-
.\" Source: quick-lint-js version 0.3.0
13+
.\" Source: quick-lint-js version  0.3.0
1414
.\" Language: English
1515
.\"
16-
.TH "QUICK\-LINT\-JS" "1" "" "quick\-lint\-js version 0.3.0" "\ \&"
16+
.TH "QUICK\-LINT\-JS" "1" "" "quick\-lint\-js version  0.3.0" "\ \&"
1717
.ie \n(.g .ds Aq \(aq
1818
.el .ds Aq '
1919
.ss \n[.ss] 0

docs/man/quick-lint-js.config.5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
.\" Author: [see the "AUTHOR(S)" section]
1111
.\" Generator: Asciidoctor 2.0.15
1212
.\" Manual: \ \&
13-
.\" Source: quick-lint-js version 0.3.0
13+
.\" Source: quick-lint-js version  0.3.0
1414
.\" Language: English
1515
.\"
16-
.TH "QUICK\-LINT\-JS.CONFIG" "5" "" "quick\-lint\-js version 0.3.0" "\ \&"
16+
.TH "QUICK\-LINT\-JS.CONFIG" "5" "" "quick\-lint\-js version  0.3.0" "\ \&"
1717
.ie \n(.g .ds Aq \(aq
1818
.el .ds Aq '
1919
.ss \n[.ss] 0

0 commit comments

Comments
 (0)