Skip to content

Commit

Permalink
Push ondemand tar.gz to release page on tags (#1564)
Browse files Browse the repository at this point in the history
* Push ondemand tar.gz to release page on tags
Fixes #1546

* Just get release, don't try and create
  • Loading branch information
treydock committed Nov 4, 2021
1 parent fd5d39a commit cbd216f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
name: Release OnDemand
steps:
- name: Set version
id: version
run: echo ::set-output name=version::${GITHUB_REF#refs/*/v}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Ruby using Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7.1"
bundler: "2.1.4"
bundler-cache: true
- name: Generate tar.gz
run: bundle exec rake package:tar
env:
VERSION: ${{ steps.version.outputs.version }}
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Release files
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: packaging/rpm/ondemand-${{ steps.version.outputs.version }}.tar.gz
asset_name: ondemand-${{ steps.version.outputs.version }}.tar.gz
asset_content_type: application/gzip
4 changes: 2 additions & 2 deletions lib/tasks/packaging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def deb_build_cmd(packaging_dir, work_dir, output_dir, dist, version, extra_args
dist = args[:dist] || 'el8'
cmd = ['git', 'ls-files', '|', tar, '-c']
if dist =~ /^el/
dir = File.join(proj_root, 'packaging/rpm')
version = rpm_version
tar_file = "packaging/rpm/v#{version}.tar.gz"
else
dir = File.join(Dir.pwd, 'build').tap { |p| sh "mkdir -p #{p}" }
version = deb_version
tar_file = "#{dir}/#{ood_package_name}-#{version}.tar.gz"
cmd.concat ["--transform 'flags=r;s,packaging/deb,debian,'"]
end
tar_file = "#{dir}/#{ood_package_name}-#{version}.tar.gz"
cmd.concat ["--transform 's,^,#{ood_package_name}-#{version}/,'"]
cmd.concat ['-T', '-', '|', "gzip > #{tar_file}"]

Expand Down
2 changes: 1 addition & 1 deletion packaging/rpm/ondemand.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Summary: Web server that provides users access to HPC resources
Group: System Environment/Daemons
License: MIT
URL: https://osc.github.io/Open-OnDemand
Source0: https://github.com/OSC/%{package_name}/archive/%{git_tag}.tar.gz
Source0: https://github.com/OSC/%{package_name}/releases/download/%{git_tag}/%{package_name}-%{git_tag_minus_v}.tar.gz
Source1: ondemand-selinux.te
Source2: ondemand-selinux.fc

Expand Down

0 comments on commit cbd216f

Please sign in to comment.