-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from littlefs-project/devel
Minor release: v2.7
- Loading branch information
Showing
18 changed files
with
869 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: release | ||
on: | ||
workflow_run: | ||
workflows: [test] | ||
branches: [master] | ||
types: [completed] | ||
|
||
defaults: | ||
run: | ||
shell: bash -euv -o pipefail {0} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-22.04 | ||
|
||
# need to manually check for a couple things | ||
# - tests passed? | ||
# - we are the most recent commit on master? | ||
if: ${{github.event.workflow_run.conclusion == 'success' && | ||
github.event.workflow_run.head_sha == github.sha}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{github.event.workflow_run.head_sha}} | ||
# need workflow access since we push branches | ||
# containing workflows | ||
token: ${{secrets.BOT_TOKEN}} | ||
# need all tags | ||
fetch-depth: 0 | ||
|
||
- name: find-version | ||
run: | | ||
# rip version from lfs_fuse.c | ||
LFS_FUSE_VERSION="$( \ | ||
grep -o '^#define LFS_FUSE_VERSION .*$' lfs_fuse.c \ | ||
| awk '{print $3}')" | ||
LFS_FUSE_VERSION_MAJOR="$((0xffff & ($LFS_FUSE_VERSION >> 16)))" | ||
LFS_FUSE_VERSION_MINOR="$((0xffff & ($LFS_FUSE_VERSION >> 0)))" | ||
# find a new patch version based on what we find in our tags | ||
LFS_FUSE_VERSION_PATCH="$( \ | ||
( git describe --tags --abbrev=0 \ | ||
--match="v$LFS_FUSE_VERSION_MAJOR.$LFS_FUSE_VERSION_MINOR.*" \ | ||
|| echo 'v0.0.-1' ) \ | ||
| awk -F '.' '{print $3+1}')" | ||
# found new version | ||
LFS_FUSE_VERSION="v$LFS_FUSE_VERSION_MAJOR` | ||
`.$LFS_FUSE_VERSION_MINOR` | ||
`.$LFS_FUSE_VERSION_PATCH" | ||
echo "LFS_FUSE_VERSION=$LFS_FUSE_VERSION" | ||
echo "LFS_FUSE_VERSION=$LFS_FUSE_VERSION" >> $GITHUB_ENV | ||
echo "LFS_FUSE_VERSION_MAJOR=$LFS_FUSE_VERSION_MAJOR" >> $GITHUB_ENV | ||
echo "LFS_FUSE_VERSION_MINOR=$LFS_FUSE_VERSION_MINOR" >> $GITHUB_ENV | ||
echo "LFS_FUSE_VERSION_PATCH=$LFS_FUSE_VERSION_PATCH" >> $GITHUB_ENV | ||
# try to find previous version? | ||
- name: find-prev-version | ||
continue-on-error: true | ||
run: | | ||
LFS_FUSE_PREV_VERSION="$( \ | ||
git describe --tags --abbrev=0 --match 'v*' \ | ||
|| true)" | ||
echo "LFS_FUSE_PREV_VERSION=$LFS_FUSE_PREV_VERSION" | ||
echo "LFS_FUSE_PREV_VERSION=$LFS_FUSE_PREV_VERSION" >> $GITHUB_ENV | ||
# find changes from history | ||
- name: create-changes | ||
run: | | ||
[ -n "$LFS_FUSE_PREV_VERSION" ] || exit 0 | ||
# use explicit link to github commit so that release notes can | ||
# be copied elsewhere | ||
git log "$LFS_FUSE_PREV_VERSION.." \ | ||
--grep='^Merge' --invert-grep \ | ||
--format="format:[\`%h\`](` | ||
`https://github.com/$GITHUB_REPOSITORY/commit/%h) %s" \ | ||
> changes.txt | ||
echo "CHANGES:" | ||
cat changes.txt | ||
# create and update major branches (vN) | ||
- name: create-major-branches | ||
run: | | ||
# create major branch | ||
git branch "v$LFS_FUSE_VERSION_MAJOR" HEAD | ||
# push! | ||
git push --atomic origin "v$LFS_FUSE_VERSION_MAJOR" | ||
# build release notes | ||
- name: create-release | ||
run: | | ||
# create release and patch version tag (vN.N.N) | ||
# only draft if not a patch release | ||
touch release.txt | ||
[ -e changes.txt ] && cat changes.txt >> release.txt | ||
cat release.txt | ||
curl -sS -X POST -H "authorization: token ${{secrets.BOT_TOKEN}}" \ | ||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases" \ | ||
-d "$(jq -n --rawfile release release.txt '{ | ||
tag_name: env.LFS_FUSE_VERSION, | ||
name: env.LFS_FUSE_VERSION | rtrimstr(".0"), | ||
target_commitish: "${{github.event.workflow_run.head_sha}}", | ||
draft: env.LFS_FUSE_VERSION | endswith(".0"), | ||
body: $release, | ||
}' | tee /dev/stderr)" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: test | ||
on: [push, pull_request] | ||
|
||
defaults: | ||
run: | ||
shell: bash -euv -o pipefail {0} | ||
|
||
env: | ||
CFLAGS: -Werror | ||
MAKEFLAGS: -j | ||
|
||
jobs: | ||
# self-host test with littlefs-fuse | ||
test: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install | ||
run: | | ||
# need a few things | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq gcc python3 python3-pip libfuse-dev | ||
sudo pip3 install toml | ||
gcc --version | ||
python3 --version | ||
fusermount -V | ||
- name: setup | ||
run: | | ||
# setup disk for littlefs-fuse | ||
mkdir mount | ||
LOOP=$(sudo losetup -f) | ||
sudo chmod a+rw $LOOP | ||
dd if=/dev/zero bs=512 count=128K of=disk | ||
losetup $LOOP disk | ||
echo "LOOP=$LOOP" >> $GITHUB_ENV | ||
- name: test | ||
run: | | ||
# self-host test | ||
make | ||
./lfs --format $LOOP | ||
./lfs --stat $LOOP | ||
./lfs $LOOP mount | ||
ls mount | ||
cp -r littlefs mount/littlefs | ||
cd mount/littlefs | ||
stat . | ||
ls -flh | ||
make -B test-runner | ||
make -B test | ||
cd ../.. | ||
umount mount | ||
./lfs --stat $LOOP | ||
# test older versions | ||
test-lfs2_0: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install | ||
run: | | ||
# need a few things | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq gcc python3 python3-pip libfuse-dev | ||
sudo pip3 install toml | ||
gcc --version | ||
python3 --version | ||
fusermount -V | ||
- name: setup | ||
run: | | ||
# setup disk for littlefs-fuse | ||
mkdir mount | ||
LOOP=$(sudo losetup -f) | ||
sudo chmod a+rw $LOOP | ||
dd if=/dev/zero bs=512 count=128K of=disk | ||
losetup $LOOP disk | ||
echo "LOOP=$LOOP" >> $GITHUB_ENV | ||
- name: test | ||
run: | | ||
# self-host test | ||
make | ||
./lfs -d=lfs2.0 --format $LOOP | ||
./lfs --stat $LOOP | ||
./lfs -d=lfs2.0 $LOOP mount | ||
ls mount | ||
cp -r littlefs mount/littlefs | ||
cd mount/littlefs | ||
stat . | ||
ls -flh | ||
make -B test-runner | ||
make -B test | ||
cd ../.. | ||
umount mount | ||
./lfs --stat $LOOP | ||
- name: test-migrate | ||
run: | | ||
# self-host test, this time migrating to current version | ||
make | ||
./lfs -d=lfs2.0 --format $LOOP | ||
./lfs --stat $LOOP | ||
./lfs $LOOP mount | ||
ls mount | ||
cp -r littlefs mount/littlefs | ||
cd mount/littlefs | ||
stat . | ||
ls -flh | ||
make -B test-runner | ||
make -B test | ||
cd ../.. | ||
umount mount | ||
./lfs --stat $LOOP |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.