-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.rb
executable file
·29 lines (22 loc) · 905 Bytes
/
release.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env ruby
# frozen_string_literal: true
version = ARGV.shift
if version.nil?
puts 'No version provided'
return
end
readme = File.read 'README.md'
readme_for_version = readme.gsub('Taucher2003/GitLab-Pipeline-Action@<version>',
"Taucher2003/GitLab-Pipeline-Action@#{version}")
File.write 'README.md', readme_for_version
action = File.read 'action.yml'
action_for_version = action.gsub(" image: 'Dockerfile'",
" image: 'docker://ghcr.io/taucher2003/gitlab-pipeline-action:#{version}'")
File.write 'action.yml', action_for_version
system('git add README.md action.yml')
system("git commit -m 'Create release for #{version}'")
system("git tag #{version}")
File.write 'README.md', readme
File.write 'action.yml', action
system('git add README.md action.yml')
system("git commit -m 'Reset action to development version'")