Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create publish-gem.yml #898

Merged
merged 26 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish Gem

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.8'
- name: Build gem
run: |
gem build github-pages.gemspec
- name: Publish
Copy link
Contributor

@YiMysty YiMysty Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should only run when merge into master branch or tag release I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to instead run the job when we merge into master branch?

on:
  push:
    branches:
      - main

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on:
  release:
    types: [released]

run: |
gem push github-pages.gem --key ${{ secrets.PAGES_GEM_PUBLISH }}
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.3
2.7.8
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=2.7.3
ARG RUBY_VERSION=2.7.8
FROM ruby:$RUBY_VERSION

RUN apt-get update \
Expand All @@ -8,7 +8,8 @@ RUN apt-get update \
make \
nodejs

RUN gem update --system
# final version for rubygems-update to supoprt ruby 2.7, consider removing this after upgraded to ruby 3.0
RUN gem update --system 3.4.22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're upgrading in this PR, you can probably remove this.


COPY .git /src/gh/pages-gem/.git
COPY Gemfile* /src/gh/pages-gem/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.3-alpine
FROM ruby:2.7.8-alpine

RUN apk update && apk add --no-cache \
git
Expand Down
2 changes: 1 addition & 1 deletion script/cibuild-docker
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

# Set the ruby version in the Action definition matrix.
: "${RUBY_VERSION:="2.7.3"}"
: "${RUBY_VERSION:="2.7.8"}"

docker build --build-arg "RUBY_VERSION=$RUBY_VERSION" -t github-pages .
docker run --rm --workdir /src/gh/pages-gem github-pages script/cibuild