From b0fbc4629c1339d8fc6dc0999fdcb714521d3348 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Wed, 20 Dec 2023 01:55:48 +0000 Subject: [PATCH] See if this works --- .github/workflows/preview-release.yaml | 104 +++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/preview-release.yaml diff --git a/.github/workflows/preview-release.yaml b/.github/workflows/preview-release.yaml new file mode 100644 index 00000000..826f5dd3 --- /dev/null +++ b/.github/workflows/preview-release.yaml @@ -0,0 +1,104 @@ +name: Release +on: + push: + branches: "*" + +env: + BUNDLE_PATH: /tmp/.bundle + GEM_HOME: /tmp/.bundle + GEM_PATH: /tmp/.bundle + TERM: xterm256 + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: native + - os: macos-latest + target: native + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - if: runner.os == 'macOS' + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.63.0 + target: aarch64-apple-darwin + default: true + override: true + profile: minimal + - if: runner.os != 'macOS' + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.63.0 + override: true + profile: minimal + target: aarch64-unknown-linux-gnu + - uses: actions/cache@v2 + with: + path: | + librubyfmt/ruby_checkout + key: ${{ runner.os }}-${{matrix.target}}-ruby-v1-${{ hashFiles('.git/modules/librubyfmt/ruby_checkout/HEAD') }} + - if: runner.os == 'macOS' + run: | + brew install automake bison + echo "/usr/local/opt/bison/bin:$PATH" >> $GITHUB_PATH + - run: ./script/test.sh + env: + TARGET: ${{ matrix.target }} + - run: ./script/make_release + - uses: actions/upload-artifact@v3 + with: + name: rubyfmt-release-artifact-${{ matrix.os }}-${{ matrix.target }} + path: rubyfmt-*.tar.gz + source-release: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + - run: | + TAG=$(git describe HEAD) + RELEASE_DIR="out/release" + mkdir -p ${RELEASE_DIR} + ./script/make_source_release ${TAG} + - uses: actions/upload-artifact@v3 + with: + name: rubyfmt-source-release + path: "out/release/source" + release: + runs-on: macos-latest + needs: + - build + - source-release + steps: + - uses: actions/download-artifact@v3 + with: + name: rubyfmt-source-release + - uses: actions/download-artifact@v3 + with: + name: rubyfmt-release-artifact-ubuntu-latest + - uses: actions/download-artifact@v3 + with: + name: rubyfmt-release-artifact-macos-latest + - id: vars + run: | + echo ::set-output name=tag_name::${{github.ref}}-${git rev-list --count HEAD} + # - name: Ship It 🚢 + # uses: softprops/action-gh-release@v1 + # with: + # files: rubyfmt-*.tar.gz + # fail_on_unmatched_files: true + # generate_release_notes: true + # prerelease: true + # name: ${{steps.vars.outputs.tag_name}} + # tag_name: "${{github.ref}}-${{ steps.vars.outputs.tag_name }}"