chore(deps): update dependency rake to v13.1.0 #81
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: release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: ruby | |
package-name: statique | |
bump-minor-pre-major: true | |
version-file: "lib/statique/version.rb" | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
if: ${{ steps.release.outputs.release_created }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Get Ruby version | |
id: ruby_version | |
run: echo "::set-output name=ruby-version::$(cat .ruby-version | tr -d '\n')" | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Get Statique version | |
id: statique_version | |
run: echo "::set-output name=statique-version::$(ruby -Ilib/statique -r version -e 'print Statique::VERSION')" | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Build gem | |
run: rake build | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Publish gem | |
run: | | |
mkdir -p $HOME/.gem | |
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
gem push pkg/statique-${STATIQUE_VERSION}.gem | |
gem push --key github --host https://rubygems.pkg.github.com/${{ github.actor }} pkg/statique-${STATIQUE_VERSION}.gem | |
env: | |
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" | |
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}" | |
STATIQUE_VERSION: "${{ steps.statique_version.outputs['statique-version'] }}" | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Login to Github Packages | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
RUBY_VERSION=${{ steps.ruby_version.outputs['ruby-version'] }} | |
STATIQUE_VERSION=${{ steps.statique_version.outputs['statique-version'] }} | |
tags: | | |
pusewicz/statique:latest | |
pusewicz/statique:${{ steps.statique_version.outputs['statique-version'] }} | |
ghcr.io/pusewicz/statique:latest | |
ghcr.io/pusewicz/statique:${{ steps.statique_version.outputs['statique-version'] }} | |
push: ${{ github.ref == 'refs/heads/main' }} | |
if: ${{ steps.release.outputs.release_created }} |