Skip to content

Commit

Permalink
Merge pull request #55 from littlefs-project/devel
Browse files Browse the repository at this point in the history
Minor release: v2.7
  • Loading branch information
geky authored Aug 24, 2023
2 parents ed22353 + 9ac0820 commit 5c18a43
Show file tree
Hide file tree
Showing 18 changed files with 869 additions and 194 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/release.yml
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)"
119 changes: 119 additions & 0 deletions .github/workflows/test.yml
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
90 changes: 0 additions & 90 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Copyright (c) 2022, the littlefs authors.
Copyright (c) 2017, Arm Limited. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ override CFLAGS += -I. -Ilittlefs
override CFLAGS += -std=c99 -Wall -pedantic
override CFLAGS += -D_FILE_OFFSET_BITS=64
override CFLAGS += -D_XOPEN_SOURCE=700
# enable multiversion support in littlefs
override CFLAGS += -DLFS_MULTIVERSION
# enable migrate support in littlefs
override CFLAGS += -DLFS_MIGRATE

override LFLAGS += -lfuse
Expand Down
Loading

0 comments on commit 5c18a43

Please sign in to comment.