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

packages: download latest source archive in dist task #1451

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

HashidaTKS
Copy link
Contributor

@HashidaTKS HashidaTKS commented Nov 14, 2022

By this change, we can download the latest source archive from the github release page into the top of the repository by executing "cd packages && rake dist".

Comment on lines 45 to 49
desc "Download the latest source archive"
task :source do
source_archive_url = built_package_url(nil, @archive_base_name)
download(source_archive_url, "..")
end
Copy link
Member

Choose a reason for hiding this comment

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

Can we rewrite define_archive_task instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adressed. (Also changed the description of this PR.)

Copy link
Member

Choose a reason for hiding this comment

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

We need to update title too.

Comment on lines 45 to 46
source_archive_url = built_package_url(nil, @archive_base_name)
download(source_archive_url, "..")
Copy link
Member

Choose a reason for hiding this comment

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

If we write this here, this is always processed. (rake --help also processes this.)
We should put this into file do ... end.

Copy link
Contributor Author

@HashidaTKS HashidaTKS Nov 15, 2022

Choose a reason for hiding this comment

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

Fixed. (I had misunderstand about file ... do ... end... )

@HashidaTKS HashidaTKS changed the title packages: add "source" task packages: download latest source archive in dist task Nov 14, 2022
when we execute "cd packages && rake source",
we download the latest source archive into the top
of the repository.
@HashidaTKS
Copy link
Contributor Author

@kou

Would you re-review this PR?

@kou
Copy link
Member

kou commented Nov 17, 2022

How about this?

diff --git a/packages/Rakefile b/packages/Rakefile
index bc7939453..7c5704cfc 100644
--- a/packages/Rakefile
+++ b/packages/Rakefile
@@ -42,9 +42,14 @@ class GroongaPackageTask < PackagesGroongaOrgPackageTask
   end
 
   def define_archive_task
-    file @original_archive_name do
-      File.symlink("../#{@original_archive_name}",
-                   @original_archive_name)
+    file "../#{@original_archive_name}" do
+      source_archive_url = built_package_url(:source, @archive_base_name)
+      download(source_archive_url, "..")
+    end
+
+    file @original_archive_name => "../#{@original_archive_name}" do
+      ln_s("../#{@original_archive_name}",
+           @original_archive_name)
     end
   end
 

@HashidaTKS
Copy link
Contributor Author

@kou

Thanks, I have changed the code as you indicated, and it worked fine as far as I tested.

@kou kou merged commit 166b9ed into master Nov 17, 2022
@kou kou deleted the download-source-from-rake branch November 17, 2022 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants