Skip to content

Commit 2681b31

Browse files
mosteomgrojo
andauthored
feat: 2.1 preparations (#1876)
* Release preparations * Fix workflow warning * Fix test with hardcoded index version * fix: executable permissions * feat: improved error message for unknown predefined variables in env (#1875) Now full message mentions the fact that this evaluation is expected for prededefined variables and the offending key is printed. Example: ``` error: Unknown predefined variable in environment variable 'PATH' of 'alr': Unknown formatting key: HOME ``` * fix: assorted bitrot since last release * fix: Windows installer --------- Co-authored-by: Manuel <mgrojo@gmail.com>
1 parent 438b3b1 commit 2681b31

File tree

15 files changed

+113
-55
lines changed

15 files changed

+113
-55
lines changed

.github/workflows/ci-release.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,17 @@ jobs:
236236
with:
237237
name: alr-bin-${{ matrix.platform.id }}.zip
238238

239-
# On Windows runners, 7zip is available instead of zip. Rather than
240-
# installing zip from MSYS2 we simply use 7zip.
241-
242-
- name: Package binaries (non-Windows)
243-
if: matrix.platform.os != 'windows-latest'
244-
run: zip alr-bin.zip bin/alr* LICENSE.txt
245-
246-
- name: Package binaries (Windows)
239+
# On Windows, install zip as it is not available by default
240+
- name: Install zip (Windows)
247241
if: matrix.platform.os == 'windows-latest'
248-
run: 7z a alr-bin.zip bin/alr.exe LICENSE.txt
242+
run: choco install zip
243+
244+
- name: Package binaries
245+
shell: bash
246+
# Mark executable as artifacts remove the executable bit
247+
run: |
248+
chmod +x bin/alr*
249+
zip alr-bin.zip bin/alr* LICENSE.txt
249250
250251
- name: Upload binary assets
251252
uses: actions/upload-release-asset@v1
@@ -278,6 +279,15 @@ jobs:
278279
with:
279280
name: alr-bin-x86_64-windows.zip
280281

282+
- name: Copy to preinstall location
283+
shell: bash
284+
run: |
285+
INSTALL_DIR=$PWD/alr_install
286+
echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_ENV
287+
mkdir -p $INSTALL_DIR/bin
288+
cp bin/alr.exe $INSTALL_DIR/bin
289+
cp LICENSE.txt $INSTALL_DIR
290+
281291
# We need to install MSYS2 again. This is a bit wasteful since the build
282292
# job already did it, but at least this way things are more clearly
283293
# separated. If we rely on an existing Alire, we might hit the cache rather
@@ -310,7 +320,7 @@ jobs:
310320
shell: bash
311321
working-directory: scripts/installer/
312322
env:
313-
ALR_INSTALL_DIR: ${{ runner.temp }}/alr_install
323+
ALR_INSTALL_DIR: ${{ env.INSTALL_DIR }}
314324
ALR_INSTALL_OS: ${{ runner.os }}
315325

316326
- name: Upload installer
@@ -422,7 +432,8 @@ jobs:
422432
423433
- name: Get ref version
424434
id: get_ref
425-
run: echo "::set-output name=short_sha::$(echo ${{ github.sha }} | cut -c1-8)"
435+
run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT
436+
shell: bash
426437

427438
- name: Upload as artifact
428439
uses: actions/upload-artifact@v4
@@ -447,6 +458,9 @@ jobs:
447458
with:
448459
name: alr-${{needs.appimage.outputs.short_sha}}-x86_64.AppImage.zip
449460

461+
- name: Mark as executable
462+
run: chmod +x alr.AppImage
463+
450464
- name: Upload AppImage asset
451465
if: (github.event_name == 'release')
452466
uses: actions/upload-release-asset@v1
@@ -461,12 +475,12 @@ jobs:
461475
###################
462476
# release-nightly #
463477
###################
464-
478+
465479
release-nightly:
466480
name: Nightly release on ${{ matrix.platform.id }}
467-
if: >
468-
github.event_name == 'schedule'
469-
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.release_nightly != 'false')
481+
if: >
482+
github.event_name == 'schedule'
483+
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.release_nightly != 'false')
470484
|| (github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'nightly'))
471485
needs: [build, build-macos-universal]
472486
runs-on: ${{ matrix.platform.os }}
@@ -508,16 +522,18 @@ jobs:
508522
id: date
509523
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
510524
shell: bash
511-
525+
512526
- name: Get metadata
513527
run: |
514528
touch alr-date-is-${{steps.date.outputs.date}}.txt
515529
touch alr-commit-is-${{github.sha}}.txt
516530
shell: bash
517531

518532
- name: Package binaries
519-
run: zip alr-nightly-bin-${{matrix.platform.id}}.zip bin/alr* LICENSE.txt alr-*.txt
520-
533+
run: |
534+
chmod +x bin/alr*
535+
zip alr-nightly-bin-${{matrix.platform.id}}.zip bin/alr* LICENSE.txt alr-*.txt
536+
521537
# The uploader needs Python with the github module
522538

523539
- name: Set up Python
@@ -541,8 +557,8 @@ jobs:
541557
release-nightly-appimage:
542558
name: Nightly AppImage
543559
if: >
544-
github.event_name == 'schedule'
545-
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.release_nightly != 'false')
560+
github.event_name == 'schedule'
561+
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.release_nightly != 'false')
546562
|| (github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'nightly'))
547563
needs: [appimage]
548564
runs-on: ubuntu-22.04
@@ -555,12 +571,14 @@ jobs:
555571
name: alr-${{needs.appimage.outputs.short_sha}}-x86_64.AppImage.zip
556572

557573
- name: Rename binary
558-
run: mv alr.AppImage alr-nightly-x86_64.AppImage
574+
run: |
575+
chmod +x alr.AppImage
576+
mv alr.AppImage alr-nightly-x86_64.AppImage
559577
560578
- name: Upload to release
561579
uses: pyTooling/Actions/releaser/composite@r4
562580
with:
563-
token: ${{ secrets.GITHUB_TOKEN }}
581+
token: ${{ secrets.GITHUB_TOKEN }}
564582
tag: nightly
565583
rm: false
566584
files: alr-nightly-x86_64.AppImage

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
.clang-format
44
.clangd/
5+
.repomix
6+
.vscode
57

68
*.cgpr
79
*.db

BREAKING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
Log of breaking changes in index or alr.
1+
Log of breaking changes in index or alr. Future versions are as of today and
2+
may change.
23

34
### alr 3.0.0 + index 1.4.0
45

56
- alr: removed `ALR_CONFIG` environment variable.
67
- alr: removed `alr config` command.
78

9+
### We are here
10+
811
### alr 2.1.0 + index 1.4.0
912

1013
- index: git remotes in origins are recognized even without `git+` prefix

RELEASING-post.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Checklist after releasing a new version
2+
3+
1. [ ] Update versions (to -dev)
4+
- `Alire.Version`
5+
- `alire.toml`
6+
1. [ ] Publish `alr` in community index?
7+
- [ ] Release as many dependencies as possible (all needed)
8+
- [ ] Remove corresponding pins
9+
- [ ] Publish (but with caveat? It will not be the same exact build)

RELEASING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
## Checklist for releasing a new version
22

33
1. [ ] Update Msys2 installer at https://github.com/msys2/msys2-installer/releases/
4-
1. [ ] Run local-only tests (`/testsuite/run-dev.sh`)
54
1. [ ] Update versions
65
- `Alire.Version`
76
- `alire.toml`
87
- `user-changes.md`
8+
1. [ ] In repo `alire-index`: create new index version branches if necessary.
9+
- Edit index/index.toml to match.
10+
1. [ ] Run all tests (regular+local) (`/testsuite/run-dev.sh`)
911
1. [ ] Create test release in own fork.
1012
- To verify builds succeed.
1113
- As the Windows build can rarely fail, this provides a backup .exe
12-
1. [ ] In repo `alire-index`: create new index version branches if necessary.
13-
- Edit index/index.toml to match.
14+
1. [ ] Create a proper release in alire-project/alire
15+
- Tag corresponding commit as vX.X.X (github does it if missing).
16+
- Use autogenerated release notes.
17+
- Credit all collaborators (if release notes aren't exhaustive).
1418
1. [ ] Ensure the index version is the default branch in the community repos:
1519
- alire-index
1620
- alire-index-checks (must match alire-index)
1721
- alire-index-staging (when it exists)
1822
- test-index
19-
1. [ ] Create a proper release in alire-project/alire
20-
- Tag corresponding commit as vX.X.X (github does it if missing).
21-
- Use autogenerated release notes.
22-
- Credit all collaborators (if release notes aren't exhaustive).
23-
1. Update Alire.Version and alire.toml to -dev in release branch.
23+
1. [ ] Update Alire.Version and alire.toml to -dev in release branch.
2424
1. [ ] Update stable version used in alire-index workflows
2525
- We used to use default in setup-alire, but by making it explicit we can
2626
test the new release before making it the default for everyone (next step).
27-
1. After a screening period, update default version in setup-alire repo.
27+
1. [ ] After a screening period, update default version in setup-alire repo.
2828
- For major Alire versions with breaking changes, bump the setup-alire
2929
version too.

alire.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "alr"
22
description = "Command-line tool from the Alire project"
33

4-
version = "2.1-dev"
4+
version = "2.1.0"
55

66
authors = ["Alejandro R. Mosteo", "Fabien Chouteau", "Pierre-Marie de Rodat"]
77
maintainers = ["alejandro@mosteo.com", "chouteau@adacore.com"]

doc/user-changes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This document is a development diary summarizing changes in `alr` that notably
44
affect the user experience. It is intended as a one-stop point for users to
55
stay on top of `alr` new features.
66

7+
## Release `2.2`
8+
79
## Release `2.1`
810

911
### New `--format` global switch to produce structured output
@@ -18,7 +20,7 @@ select the desired output language:
1820

1921
```
2022
$ alr --format=TOML search --crates hello
21-
[[data]]
23+
[[data]]
2224
description = "'Hello, world!' demonstration project"
2325
name = "hello"
2426
[[data]]

scripts/installer/make-alire-installer

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ create_chroot_system() {
114114
pushd "${_newalire}" > /dev/null
115115

116116
mkdir -p bin/
117-
cp -r "$ALR_INSTALL_DIR"/* .
117+
echo "Copying from ${ALR_INSTALL_DIR} to $PWD" | tee -a "${_log}"
118+
cp -rv "$ALR_INSTALL_DIR"/* .
118119

119120
mkdir -p share/alire/
120121
cp "${_thisdir}/alr_icon.ico" share/alire/
@@ -126,6 +127,15 @@ then
126127
echo "Please set \$ALR_INSTALL_DIR"
127128
exit 1
128129
fi
130+
131+
# Verify it is a folder
132+
if [ ! -d "$ALR_INSTALL_DIR" ]
133+
then
134+
echo "$ALR_INSTALL_DIR is not a folder"
135+
ls -alF "$ALR_INSTALL_DIR"
136+
exit 1
137+
fi
138+
129139
if [[ -z "$ALR_INSTALL_OS" ]]
130140
then
131141
echo "Please set \$ALR_INSTALL_OS"

src/alire/alire-index.ads

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ with Semantic_Versioning.Extended;
1616

1717
package Alire.Index is
1818

19+
Community_Branch : constant String := "stable-1.4.0";
20+
-- The branch used for the community index. Must be updated when new index
21+
-- features are introduced.
22+
1923
Community_Host : constant String := Settings.Builtins.Index_Host.Get;
2024

2125
Community_Organization : constant String :=
@@ -26,8 +30,8 @@ package Alire.Index is
2630

2731
Community_Repo : constant URL :=
2832
"git+" & Community_Host
29-
& "/" & Community_Organization
30-
& "/" & Community_Repo_Name;
33+
& "/" & Community_Organization
34+
& "/" & Community_Repo_Name;
3135
-- Default index installed on first run
3236

3337
Community_Name : constant Restricted_Name := "community";
@@ -45,10 +49,6 @@ package Alire.Index is
4549
and then Branch_String (Branch_String'Last) /= '-'
4650
and then (for some C of Branch_String => C = '-');
4751

48-
Community_Branch : constant String := "stable-1.3.0";
49-
-- The branch used for the community index. Must be updated when new index
50-
-- features are introduced.
51-
5252
Min_Compatible_Version : constant Semantic_Versioning.Version;
5353
-- Based on the constant defined in private section
5454

src/alire/alire-version.ads

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ private
1212

1313
-- Remember to update Alire.Index branch if needed too
1414

15-
-- NOTE: in the following version string, the build part (after '+') will
16-
-- be replaced by `alr build` with the current commit, and appended with
17-
-- "_or_later" after build.
18-
19-
Current_Str : constant String := "2.1.0-dev";
15+
Current_Str : constant String := "2.1.0";
16+
-- 2.1.0: new solver and other internal largish refactorings, bugfixes
2017
-- 2.0.2: quarterly bugfix maintenance release
2118
-- 2.0.1: fix `alr install` and minor fixes
2219
-- 2.0.0: alr settings refactor and minor fixes

0 commit comments

Comments
 (0)