Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Nov 16, 2024
2 parents e06b38a + 6610dc0 commit 51b10c4
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 74 deletions.
13 changes: 6 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/ruby-rails-postgres
// Update the VARIANT arg in docker-compose.yml to pick a Ruby version
// Redmine plugin boilerplate
// version: 1.0.0
{
"name": "Ruby on Rails & Postgres",
"name": "Redmine plugin",
"dockerComposeFile": "docker-compose.yml",
"service": "app",

"mounts": [
"source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind"
],
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// "workspaceFolder": "/workspaces/dev.code-workspace",

// Set *default* container specific settings.json values on container create.
"settings": {
Expand Down Expand Up @@ -42,7 +40,6 @@

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"rebornix.Ruby",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"craigmaslowski.erb",
Expand All @@ -53,7 +50,9 @@
"ms-azuretools.vscode-docker",
"KoichiSasada.vscode-rdbg",
"Serhioromano.vscode-gitflow",
"github.vscode-github-actions"
"github.vscode-github-actions",
"Shopify.ruby-extensions-pack",
"ritwickdey.LiveServer"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ services:
# Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.6
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
RUBY_VERSION: "3.1"
RUBY_VERSION: "3.2"
# Optional Node.js version to install
NODE_VERSION: "lts/*"
REDMINE_VERSION: "5.1-stable"
REDMINE_VERSION: "6.0-stable"

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
Expand Down
14 changes: 14 additions & 0 deletions .devcontainer/plugin_generator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

cd `dirname $0`
cd ..
BASEDIR=`pwd`
PLUGIN_NAME=`basename $BASEDIR`
echo $PLUGIN_NAME

cd $REDMINE_ROOT

export RAILS_ENV="production"

bundle exec rails generate redmine_plugin $PLUGIN_NAME
14 changes: 9 additions & 5 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#!/bin/sh
cd /usr/local/redmine
cd $REDMINE_ROOT

if [ -d .git.sv ]
then
mv -s .git.sv .git
git pull
rm .git
fi

ln -s /workspaces/${PLUGIN_NAME} plugins/${PLUGIN_NAME}
if [ -f plugins/${PLUGIN_NAME}/Gemfile_for_test ]
then
cp plugins/${PLUGIN_NAME}/Gemfile_for_test plugins/${PLUGIN_NAME}/Gemfile
fi
cp plugins/${PLUGIN_NAME}/test/fixtures/*.yml test/fixtures
ln -s /workspaces/${PLUGIN_NAME}/.devcontainer/launch.json .vscode/launch.json


bundle install
bundle exec rake redmine:plugins:migrate
bundle exec rake redmine:plugins:migrate RAILS_ENV=test

initdb() {
bundle exec rake db:create
Expand Down
11 changes: 11 additions & 0 deletions .devcontainer/redmine.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": ".."
},
{
"path": "../../../usr/local/redmine"
}
],
"settings": {}
}
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: build
on:
push:
branches-ignore:
pull_request:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -11,17 +10,8 @@ jobs:
strategy:
matrix:
db: [sqlite3, mysql, postgres]
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
redmine_version: [4.2-stable, 5.0-stable, 5.1-stable, master]
exclude:
- ruby_version: "3.0"
redmine_version: 4.2-stable
- ruby_version: "3.1"
redmine_version: 4.2-stable
- ruby_version: "3.2"
redmine_version: 4.2-stable
- ruby_version: "3.2"
redmine_version: 5.0-stable
ruby_version: ["3.1", "3.2", "3.3"]
redmine_version: [6.0-stable, master]
services:
mysql:
image: mysql:5.7
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- '**'
tags:
- '**'
permissions:
contents: write
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
Expand All @@ -16,31 +18,15 @@ jobs:
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
echo ::set-output name=plugin::$REPOSITORY
- uses: actions/checkout@v2
echo "version=$VERSION" >> $GITHUB_ENV
echo "filename=$REPOSITORY-$VERSION" >> $GITHUB_ENV
echo "plugin=$REPOSITORY" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Archive
run: |
cd ..; zip -r ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/ -x "*.git*"; mv ${{ steps.version.outputs.filename }}.zip ${{ steps.version.outputs.plugin }}/
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cd ..; zip -r ${{ env.filename }}.zip ${{ env.plugin }}/ -x "*.git*"; mv ${{ env.filename }}.zip ${{ env.plugin }}/
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: ${{ steps.version.outputs.version }}
body: ''
draft: false
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.version.outputs.filename }}.zip
asset_name: ${{ steps.version.outputs.filename }}.zip
asset_content_type: application/zip
draft: true
files: ${{ env.filename }}.zip
11 changes: 0 additions & 11 deletions .redmine.code-workspace

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile_for_test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

group :test do
gem 'factory_girl_rails'
# gem 'factory_girl_rails'
#gem 'shoulda-matchers'
gem 'shoulda'
gem 'simplecov-lcov', :require => false
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsComment < ActiveRecord::Base
class WikiExtensionsComment < ApplicationRecord
belongs_to :user
belongs_to :wiki_page
validates_presence_of :comment, :wiki_page_id, :user_id
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_count.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsCount < ActiveRecord::Base
class WikiExtensionsCount < ApplicationRecord
belongs_to :project
belongs_to :page, :foreign_key => :page_id, :class_name => 'WikiPage'
validates_presence_of :project
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsMenu < ActiveRecord::Base
class WikiExtensionsMenu < ApplicationRecord
include Redmine::SafeAttributes
belongs_to :project
validates_presence_of :project_id
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsSetting < ActiveRecord::Base
class WikiExtensionsSetting < ApplicationRecord
belongs_to :project
#attr_accessible :auto_preview_enabled, :tag_disabled

Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsTag < ActiveRecord::Base
class WikiExtensionsTag < ApplicationRecord
#attr_accessible :name, :project_id
validates_presence_of :name, :project_id
validates_uniqueness_of :name, :scope => :project_id
Expand Down
2 changes: 1 addition & 1 deletion app/models/wiki_extensions_tag_relation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WikiExtensionsTagRelation < ActiveRecord::Base
class WikiExtensionsTagRelation < ApplicationRecord
belongs_to :wiki_page
belongs_to :tag, :class_name => 'WikiExtensionsTag', :foreign_key => :tag_id
validates_presence_of :wiki_page_id, :tag_id
Expand Down
3 changes: 1 addition & 2 deletions app/models/wiki_extensions_vote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WikiExtensionsVote < ActiveRecord::Base
class WikiExtensionsVote < ApplicationRecord
validates_presence_of :target_class_name, :target_id, :keystr, :count
validates_uniqueness_of :keystr, :scope => [:target_class_name, :target_id]

Expand Down Expand Up @@ -48,4 +48,3 @@ def self.find_or_create(class_name, obj_id, key_str)
return vote
end
end

6 changes: 3 additions & 3 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Wiki Extensions plugin for Redmine
# Copyright (C) 2009-2023 Haruyuki Iida
# Copyright (C) 2009-2024 Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -42,8 +42,8 @@
author_url 'http://twitter.com/haru_iida'
description 'This is a Wiki Extensions plugin for Redmine'
url 'http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en'
version '0.9.5'
requires_redmine :version_or_higher => '4.0.0'
version '1.0.0'
requires_redmine :version_or_higher => '6.0.0'

project_module :wiki_extensions do
permission :wiki_extensions_vote, { :wiki_extensions => [:vote, :show_vote] }, :public => true
Expand Down

0 comments on commit 51b10c4

Please sign in to comment.