2 次代碼提交 7c2f57557b ... 899511e118

作者 SHA1 備註 提交日期
  Wiktor Plaga 899511e118 ADD hub.docker.com 3 月之前
  Wiktor Plaga 3a4d985f0f UPD rubygems.org 3 月之前
共有 3 個文件被更改,包括 74 次插入3 次删除
  1. 49 0
      .github/workflows/dockerhub.yml
  2. 13 0
      Dockerfile
  3. 12 3
      safeutils.gemspec

+ 49 - 0
.github/workflows/dockerhub.yml

@@ -0,0 +1,49 @@
+name: DockerHub Release
+# see: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  dockerhub:
+    name: Push Docker image to Docker Hub
+    runs-on: ubuntu-latest
+    permissions:
+      packages: write
+      contents: read
+      attestations: write
+      id-token: write
+    steps:
+      - name: Check out the repo
+        uses: actions/checkout@v4
+
+      - name: Log in to Docker Hub
+        uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
+
+      - name: Extract metadata (tags, labels) for Docker
+        id: meta
+        uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
+        with:
+          images: safeutils/safeutils
+
+      - name: Build and push Docker image
+        id: push
+        uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
+        with:
+          context: .
+          file: ./Dockerfile
+          push: true
+          tags: ${{ steps.meta.outputs.tags }}
+          labels: ${{ steps.meta.outputs.labels }}
+
+
+      # * name: Generate artifact attestation
+      #   uses: actions/attest-build-provenance@v1
+      #   with:
+      #     subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
+      #     subject-digest: ${{ steps.push.outputs.digest }}
+      #     push-to-registry: true

+ 13 - 0
Dockerfile

@@ -0,0 +1,13 @@
+FROM alpine:latest
+LABEL "com.safeutils"="SafeUtils"
+LABEL version="0.0.1"
+LABEL description="110+ developer tools as secure, native MacOS, Linux & Windows desktop apps."
+
+RUN apk --no-cache add \
+bash \
+jq \
+curl \
+git \
+yq \
+# https://wiki.alpinelinux.org/wiki/Change_default_shell
+&& sed -i s/ash/bash/ /etc/passwd

+ 12 - 3
safeutils.gemspec

@@ -8,12 +8,21 @@ Gem::Specification.new do |spec|
   spec.name          = 'safeutils'
   spec.version       = SafeUtils::VERSION
   spec.authors       = ['Wiktor Plaga']
-  spec.license       = 'Nonstandard'
-  spec.email         = ['support@safeutils.com']
+  spec.license       = 'MIT'
+  spec.email         = 'support@safeutils.com'
   spec.date          = '2024-06-27'
+  spec.description   = '110+ developer tools as secure, native MacOS, Linux & Windows desktop apps.'
   spec.summary       = 'SafeUtils: Native MacOS, Linux and Windows desktop application with 110+ carefully crafted tools for yours and your teams everyday work with sensitive data in various formats.'
   spec.homepage      = 'https://safeutils.com'
-  spec.files         = ['src/safe_utils.rb']
+  spec.files         = ['README.md', 'LICENSE.md', 'src/safe_utils.rb']
   spec.require_paths = ['src']
+  spec.metadata      = {
+     "bug_tracker_uri"    => 'https://safeutils.com/contact',
+      "changelog_uri"     => "https://safeutils.com/releases/#{SafeUtils::VERSION.gsub(".", "_")}",
+      "documentation_uri" => 'https://safeutils.com/releases',
+      "mailing_list_uri"  => 'https://safeutils.com/news',
+      "source_code_uri"   => 'https://github.com/safe-utils/.github',
+      # "rubygems_mfa_required" => "true",
+  }
   spec.required_ruby_version = '>= 3.0.0'
 end