Skip to content

ci: add graphite's optimizer to the runs #73

ci: add graphite's optimizer to the runs

ci: add graphite's optimizer to the runs #73

on:
push:
branches:
- devel
- RELEASE*
name: Create Github Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
optimize_ci:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- name: Optimize CI
id: check_skip
uses: withgraphite/graphite-ci-action@main
with:
graphite_token: ${{secrets.GRAPHITE_TOKEN}}
create-release:
runs-on: ubuntu-latest
needs: [optimize_ci]
if: needs.optimize_ci.outputs.skip == 'false'
permissions:
contents: write
outputs:
tag_version: ${{ steps.create_release.outputs.tag_version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Get most recent tag
id: get_tag
run: echo "TAG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> "$GITHUB_ENV"
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "Creating release for tag $TAG_VERSION"
gh release create $TAG_VERSION --title "Release $TAG_VERSION" --notes "Release $TAG_VERSION" --target ${{ github.ref }}
echo "tag_version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
create_release_artifacts:
needs: [create-release]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
r_version: ['release', 'devel']
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install system dependencies
run: |
sudo apt-get install -y libxml2-dev \
libssl-dev libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev \
pandoc
- name: Setup R
uses: r-lib/actions/setup-r@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
with:
r-version: ${{ matrix.r_version }}
use-public-rspm: true
id: r
- name: Install dependencies
uses: r-lib/actions/setup-renv@e6be4b3706e0f39bc7a4cf4496a5f2c4cb840040 # v2.10.1
- name: Build Package
run: R CMD build .
- name: Rename Package
run: echo "NEWNAME=$(./utilities/rename-package.R *.tar.gz)" >> "$GITHUB_ENV"
- name: debug
run: |
echo "R version: ${{ steps.r.outputs.installed-r-version }}"
echo "Current Tag: ${{ needs.create-release.outputs.tag_version }}"
echo "Release File Name: ${{ env.NEWNAME }}"
- name: Upload Release Artifact
env:
RELEASE_TAG: ${{ needs.create-release.outputs.tag_version }}
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ env.RELEASE_TAG }} ${{ env.NEWNAME }}