Skip to content

Commit

Permalink
[ci] use different file name for tagged commit
Browse files Browse the repository at this point in the history
misc cleanup, add some blank lines and indentations
  • Loading branch information
oldk1331 committed Jun 11, 2024
1 parent 873c5b3 commit a57bd80
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,27 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install sbcl libgmp-dev libxpm-dev
- name: configure
run: ./configure --with-lisp=sbcl --with-gmp --with-x || cat config.log

- name: make
run: make -j4 --output-sync

- name: make check
run: make check -j4 --output-sync

- name: Create artifact archives
run: |
test "$GITHUB_REF_TYPE" != "tag" && rm -r target/*/src
tar -cjf FriCAS-linux-x86_64-${{ github.sha }}.tar.bz2 target/
- name: Upload Linux binary
uses: actions/upload-artifact@v4
with:
name: FriCAS-linux-x86_64-binary
path: FriCAS-linux-x86_64-${{ github.sha }}.tar.bz2

- name: Upload to nightly release
if: ${{ github.event_name == 'push' && ( github.event.ref == 'refs/heads/master' || github.ref_type == 'tag' ) && github.repository == 'fricas/fricas' }}
## RELEASE_ID is:
Expand All @@ -38,10 +44,12 @@ jobs:
export RELEASE_ID=74905307
export TIMESTAMP=$(date +%Y-%m-%dT%H.%M)
export SHA=$(echo ${{ github.sha }} | cut -c 1-8)
export FILENAME=FriCAS-${TIMESTAMP}-linux-x86_64-${SHA}.tar.bz2
export FILENAME1=FriCAS-${TIMESTAMP}-linux-x86_64-${SHA}.tar.bz2
export FILENAME2=fricas-${GITHUB_REF_NAME}-linux-x86_64.tar.bz2
export FILENAME=$(test "$GITHUB_REF_TYPE" != "tag" && echo $FILENAME1 || echo $FILENAME2)
export URL=https://uploads.github.com/${REPO_URL}/${RELEASE_ID}/assets
curl -v -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-linux-x86_64-${{ github.sha }}.tar.bz2" \
-H "Content-Type: application/x-bzip2" || true
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-linux-x86_64-${{ github.sha }}.tar.bz2" \
-H "Content-Type: application/x-bzip2" || true
18 changes: 13 additions & 5 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ jobs:
wget https://downloads.sourceforge.net/project/sbcl/sbcl/${SBCL_VER}/sbcl-${SBCL_VER}-${ARCH}-darwin-binary.tar.bz2
tar xvf sbcl-${SBCL_VER}-${ARCH}-darwin-binary.tar.bz2
cd sbcl-${SBCL_VER}-${ARCH}-darwin && sudo ./install.sh
- name: configure
run: |
mkdir ../build && cd ../build
../fricas/configure --with-lisp=sbcl --with-gmp=`brew --prefix` || cat config.log
- name: make
run: cd ../build && make -j3

- name: make check
run: cd ../build && make check -j3

- name: Create artifact archives
run: |
cd ../build
Expand All @@ -39,11 +43,13 @@ jobs:
## reduce chance of error caused by "hdiutil: Resource busy"
make dist-macos-dmg || make dist-macos-dmg
mv FriCAS.dmg ../fricas/FriCAS-macOS-${ARCH}-${{ github.sha }}.dmg
- name: Upload macOS binary
uses: actions/upload-artifact@v4
with:
name: FriCAS-macOS-${{ env.ARCH }}-binary
path: FriCAS-macOS-${{ env.ARCH }}-${{ github.sha }}.dmg

- name: Upload to nightly release
if: ${{ github.event_name == 'push' && ( github.event.ref == 'refs/heads/master' || github.ref_type == 'tag' ) && github.repository == 'fricas/fricas' }}
## RELEASE_ID is:
Expand All @@ -53,10 +59,12 @@ jobs:
export RELEASE_ID=74905307
export TIMESTAMP=$(date +%Y-%m-%dT%H.%M)
export SHA=$(echo ${{ github.sha }} | cut -c 1-8)
export FILENAME=FriCAS-${TIMESTAMP}-macOS-${ARCH}-${SHA}.dmg
export FILENAME1=FriCAS-${TIMESTAMP}-macOS-${ARCH}-${SHA}-unsigned.dmg
export FILENAME2=fricas-${GITHUB_REF_NAME}-macOS-${ARCH}-unsigned.dmg
export FILENAME=$(test "$GITHUB_REF_TYPE" != "tag" && echo $FILENAME1 || echo $FILENAME2)
export URL=https://uploads.github.com/${REPO_URL}/${RELEASE_ID}/assets
curl -v -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-macOS-${ARCH}-${{ github.sha }}.dmg" \
-H "Content-Type: application/x-apple-diskimage" || true
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-macOS-${ARCH}-${{ github.sha }}.dmg" \
-H "Content-Type: application/x-apple-diskimage" || true
17 changes: 12 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
run: |
wget https://downloads.sourceforge.net/project/sbcl/sbcl/${SBCL_VER}/sbcl-${SBCL_VER}-x86-64-windows-binary.msi
msiexec -i sbcl-${SBCL_VER}-x86-64-windows-binary.msi -passive
- uses: actions/checkout@v4
- name: configure and make
run: |
Expand All @@ -29,20 +30,24 @@ jobs:
mkdir ../build && cd ../build
../fricas/configure --with-lisp=sbcl --enable-gmp || cat config.log
make -j4 --output-sync
- name: make check
run: cd ../build && make check -j4 --output-sync

- name: Create artifact archives
run: |
test "$GITHUB_REF_TYPE" != "tag" && rm -r ../build/target/*/src
rm ../build/target/x86_64-w64-mingw32/bin/fricas
mv ../build/target/x86_64-w64-mingw32 FriCAS-windows-x86_64
cp /mingw64/bin/libgmp-10.dll FriCAS-windows-x86_64/lib/
zip -r FriCAS-windows-x86_64-${{ github.sha }}.zip FriCAS-windows-x86_64
- name: Upload Windows binary
uses: actions/upload-artifact@v4
with:
name: FriCAS-windows-x86_64-binary
path: FriCAS-windows-x86_64-${{ github.sha }}.zip

- name: Upload to nightly release
if: ${{ github.event_name == 'push' && ( github.event.ref == 'refs/heads/master' || github.ref_type == 'tag' ) && github.repository == 'fricas/fricas' }}
## RELEASE_ID is:
Expand All @@ -52,10 +57,12 @@ jobs:
export RELEASE_ID=74905307
export TIMESTAMP=$(date +%Y-%m-%dT%H.%M)
export SHA=$(echo ${{ github.sha }} | cut -c 1-8)
export FILENAME=FriCAS-${TIMESTAMP}-windows-x86_64-${SHA}.zip
export FILENAME1=FriCAS-${TIMESTAMP}-windows-x86_64-${SHA}.zip
export FILENAME2=fricas-${GITHUB_REF_NAME}-windows-x64.zip
export FILENAME=$(test "$GITHUB_REF_TYPE" != "tag" && echo $FILENAME1 || echo $FILENAME2)
export URL=https://uploads.github.com/${REPO_URL}/${RELEASE_ID}/assets
curl -v -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-windows-x86_64-${{ github.sha }}.zip" \
-H "Content-Type: application/zip" || true
-H "Authorization: token ${{ secrets.releasetoken }}" \
"${URL}?name=${FILENAME}" \
--data-binary "@FriCAS-windows-x86_64-${{ github.sha }}.zip" \
-H "Content-Type: application/zip" || true

0 comments on commit a57bd80

Please sign in to comment.