chore: bundle install so we can fetch src #33
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
name: Linux | |
on: | |
push: | |
branches: [ master, ci_test ] | |
pull_request: | |
branches: [ master, ci_test ] | |
workflow_dispatch: | |
env: | |
REPO: you54f/ruby-packer | |
PKG_DATE: 20230812 | |
NEXT_TAG: rel-20230812 | |
PUBLISH_BRANCH: next | |
jobs: | |
make: | |
strategy: | |
matrix: | |
os: [ubuntu-22.04] | |
ruby: ['3.2'] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "[Enclose.IO] Install dependencies" | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential squashfs-tools automake libtool bison | |
- name: Install GCC 9 | |
run: sudo apt-get update && sudo apt-get install -y gcc-9 g++-9 && sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 | |
- uses: actions/checkout@v3 | |
- name: "[Enclose.IO] Check dependencies" | |
run: | | |
cat /etc/issue | |
uname -a | |
uname -p | |
uname -m | |
lscpu | |
which mksquashfs | |
mksquashfs -version | |
- name: Set up Clang | |
uses: egor-tensin/setup-clang@v1 | |
with: | |
version: latest | |
platform: 6 | |
- name: "[Enclose.IO] Set up Ruby" | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
- name: "[Enclose.IO] Install rubocop" | |
run: gem install rubocop | |
- name: "[Enclose.IO] Run rubocop" | |
run: rubocop | |
# - name: "[Enclose.IO] Bundle install" | |
# run: bundle install | |
# - name: "[Enclose.IO] Rake" | |
# run: bundle exec rake | |
- name: "Install bundle" | |
run: bundle install | |
- name: "Download and Patch ruby source" | |
run: bundle exec rake patch_ruby_source | |
- name: "Build rubyc" | |
run: bundle exec rake rubyc | |
- name: "Package rubyc" | |
run: | | |
mkdir -p pkg | |
export RUBYC_FILENAME=rubyc-$(uname -s)-$(uname -m)-gha | |
export RUBYC_ARCHIVE_FILENAME=${RUBYC_FILENAME}.tar.gz | |
cp rubyc pkg/$RUBYC_FILENAME | |
cd pkg | |
tar -czvf $RUBYC_ARCHIVE_FILENAME $RUBYC_FILENAME | |
echo "RUBYC_FILENAME=$RUBYC_FILENAME" >> $GITHUB_ENV | |
echo "RUBYC_ARCHIVE_FILENAME=$RUBYC_ARCHIVE_FILENAME" >> $GITHUB_ENV | |
ls -l | |
if [[ $GITHUB_REF == "refs/heads/$PUBLISH_BRANCH" ]]; then | |
gh release upload "${NEXT_TAG}" $RUBYC_ARCHIVE_FILENAME --repo "${REPO}" --clobber | |
else | |
echo "Not on $PUBLISH_BRANCH branch, skipping upload" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "[Enclose.IO] Create Linux Test run upload" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ github.env.RUBYC_ARCHIVE_FILENAME }} | |
path: pkg/${{ github.env.RUBYC_ARCHIVE_FILENAME }} | |
upload: | |
defaults: | |
run: | |
shell: sh | |
needs: [make] | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
- name: test ${{ matrix.os }} package | |
run: | | |
export RUBYC_FILENAME=rubyc-$(uname -s)-$(uname -m)-gha | |
export RUBYC_ARCHIVE_FILENAME=${RUBYC_FILENAME}.tar.gz | |
ls | |
if [[ $GITHUB_REF == "refs/heads/$PUBLISH_BRANCH" ]]; then | |
gh release upload $NEXT_TAG $RUBYC_ARCHIVE_FILENAME --repo $REPO --clobber | |
else | |
echo "Not on $PUBLISH_BRANCH branch, skipping upload" | |
fi | |
env: # note move publishing to a seperate job, token doesnt have perms for release upload | |
GITHUB_TOKEN: ${{ github.token }} |