Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 32 additions & 48 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,37 @@ jobs:
make-snapshot:
runs-on: ubuntu-latest
steps:
- name: Set TARGET_VERSION
- name: Set TARGET_VERSION and FETCH_REF
run: |
if [ -z "$TARGET_VERSION" ]; then
GITHUB_REF=${GITHUB_EVENT_ACTION:-$(echo $GITHUB_REF | sed -e "s#/draft/#/#")}
TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./")
fi
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT
if ruby -e "major = Integer('${TARGET_VERSION}'.split('.', 2).first); exit(major>=4)"; then
FETCH_REF="refs/tags/v${TARGET_VERSION}"
else
FETCH_REF="refs/tags/v$(echo $TARGET_VERSION | sed 'y/.-/__/')"
fi
Comment on lines +27 to +31
# e.g. GITHUB_REF=refs/tags/draft/v2_7_0_preview1 -> TARGET_VERSION=2.7.0-preview1
{
echo TARGET_VERSION="$TARGET_VERSION"
echo PACKAGE_EXTS=".tar.gz .tar.xz .zip"
} >> $GITHUB_ENV
{
echo "target_version=$TARGET_VERSION"
echo "fetch_ref=$FETCH_REF"
} >> "$GITHUB_OUTPUT"
shell: bash
id: info
env:
GITHUB_EVENT_ACTION: ${{ github.event.action }} # repository_dispatch
TARGET_VERSION: ${{ github.event.inputs.TARGET_VERSION }} # workflow_dispatch

- name: Install libraries
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential git bison autoconf ruby p7zip-full curl
- name: Checkout ruby/ruby for tool/make-snapshot
run: git clone --single-branch --depth=1 https://github.com/ruby/ruby ruby
- name: Make pkg
run: |
set -x
if ruby -e "major = Integer('${TARGET_VERSION}'.split('.', 2).first); exit(major>=4)"; then
GITHUB_REF_RUBY_RUBY="refs/tags/v${TARGET_VERSION}"
else
GITHUB_REF_RUBY_RUBY="refs/tags/v$(echo $TARGET_VERSION | sed 'y/.-/__/')"
fi
# e.g. GITHUB_REF=refs/tags/draft/v2_7_0_preview1 -> TARGET_VERSION=2.7.0-preview1
pushd ruby
git fetch --shallow-since='2018-12-25 00:00:00'
git fetch origin "+${GITHUB_REF_RUBY_RUBY}:${GITHUB_REF_RUBY_RUBY}"
git fetch origin +refs/notes/commits:refs/notes/commits
git fetch origin +refs/notes/log-fix:refs/notes/log-fix
popd
# exclude bzip from -packages
ruby ruby/tool/make-snapshot -srcdir=ruby -packages=gzip,xz,zip pkg ${TARGET_VERSION}
echo PACKAGE_EXTS=".tar.gz .tar.xz .zip" >> $GITHUB_ENV
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Packages
path: pkg
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- uses: ruby/ruby/.github/actions/make-snapshot@master
with:
name: Info
path: pkg/info
archname: ruby-${{ steps.info.outputs.target_version }}
version: ${{ steps.info.outputs.target_version }}
fetch-branch: ${{ steps.info.outputs.fetch_ref }}
Comment on lines +47 to +51
- name: Check pkg
run: |
set -x
Expand All @@ -91,9 +75,9 @@ jobs:
payload: |
{
"attachments": [{
"title": "Build Draft Release ${{ steps.info.outputs.TARGET_VERSION }}",
"title": "Build Draft Release ${{ steps.info.outputs.target_version }}",
"title_link": "https://cache.ruby-lang.org/pub/tmp/",
"text": "${{ job.status }}: make-snapshot <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: make-snapshot <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "danger"
}]
}
Expand All @@ -105,9 +89,9 @@ jobs:
payload: |
{
"attachments": [{
"title": "Build Draft Release ${{ steps.info.outputs.TARGET_VERSION }}",
"title": "Build Draft Release ${{ steps.info.outputs.target_version }}",
"title_link": "https://cache.ruby-lang.org/pub/tmp/",
"text": "${{ job.status }}: make-snapshot <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: make-snapshot <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "good"
}]
}
Expand All @@ -131,7 +115,7 @@ jobs:
TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./")
fi
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT
echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
id: info
env:
Expand Down Expand Up @@ -233,7 +217,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "danger"
}]
}
Expand All @@ -245,7 +229,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "good"
}]
}
Expand All @@ -272,7 +256,7 @@ jobs:
TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./")
fi
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT
echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
id: info
env:
Expand Down Expand Up @@ -351,7 +335,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "danger"
}]
}
Expand All @@ -363,7 +347,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "good"
}]
}
Expand Down Expand Up @@ -391,7 +375,7 @@ jobs:
TARGET_VERSION=$(echo $GITHUB_REF | sed -e "s#refs/tags/v##" -e "s/_\([a-z]\)/-\1/" -e "y/_/./")
fi
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_ENV
echo TARGET_VERSION="$TARGET_VERSION" >> $GITHUB_OUTPUT
echo "target_version=$TARGET_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
id: info
env:
Expand Down Expand Up @@ -498,7 +482,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "danger"
}]
}
Expand All @@ -510,7 +494,7 @@ jobs:
payload: |
{
"attachments": [{
"text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.TARGET_VERSION }}>",
"text": "${{ job.status }}: ${{ matrix.os }} (vs${{ matrix.vs }}) / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }} at ${{ steps.info.outputs.target_version }}>",
"color": "good"
}]
}
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/upload-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,13 @@ jobs:
include: ${{ fromJSON(needs.matrix.outputs.matrix) }}
env:
archname: ${{ matrix.archname }}
FETCH_BRANCH: ${{ matrix.fetch_branch }}
VERSION: ${{ matrix.version }}
steps:
- name: Install libraries
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential git bison autoconf ruby p7zip-full curl
- name: Checkout ruby/ruby
run: git clone --single-branch --depth=1 https://github.com/ruby/ruby ruby
- name: Fetch branches and notes
run: |
set -x
cd ruby
git fetch --shallow-since='2018-12-25 00:00:00'
[ -n "$FETCH_BRANCH" ] && git fetch origin "+$FETCH_BRANCH:$FETCH_BRANCH"
git fetch origin '+refs/notes/commits:refs/notes/commits'
git fetch origin '+refs/notes/log-fix:refs/notes/log-fix'
- name: Make snapshot
run: ruby ruby/tool/make-snapshot -archname=$archname -srcdir=ruby -packages=gzip,xz,zip pkg $VERSION
- uses: ruby/ruby/.github/actions/make-snapshot@master
with:
archname: ${{ matrix.archname }}
version: ${{ matrix.version }}
fetch-branch: ${{ matrix.fetch_branch }}
upload-artifact: 'false'
Comment on lines +57 to +62
- name: Check pkg
run: |
set -x
Expand Down