(maint) pdksync - PDK Update
[puppet-modules/puppetlabs-apt.git] / .github / workflows / release.yml
index dacc2ff7aa7b89ce7e0e5938339b29b0c9b0ea7e..1509f6e91f9a5f44ad6b295cf6fa20d1c697dda4 100644 (file)
@@ -1,43 +1,47 @@
-name: "release"
-
-on: 
-  push:
-    branches:
-      - 'release'
+name: "Publish module"
 
+on:
+  workflow_dispatch:
+  
 jobs:
-  LitmusAcceptance:
-    runs-on: self-hosted
-    strategy:
-      matrix:
-        ruby_version: [2.5.x]
-        puppet_gem_version: [~> 6.0]
-        platform: [release_checks]
-        agent_family: ['puppet5', 'puppet6']
-
+  create-github-release:
+    name: Deploy GitHub Release
+    runs-on: ubuntu-20.04
     steps:
-    - uses: actions/checkout@v1
-    - name: Litmus Parallel
-      uses: puppetlabs/action-litmus_parallel@master
-      with:
-        platform: ${{ matrix.platform }}
-        agent_family: ${{ matrix.agent_family }}
-  Spec:
-    runs-on: self-hosted
-    strategy:
-      matrix:
-        check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
-        ruby_version: [2.5.x]
-        puppet_gem_version: [~> 5.0, ~> 6.0]
-        exclude:
-        - puppet_gem_version: ~> 5.0
-          check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
-        - ruby_version: 2.5.x
-          puppet_gem_version: ~> 5.0
+      - name: Checkout code
+        uses: actions/checkout@v2
+        with:
+          ref: ${{ github.ref }}
+          clean: true
+          fetch-depth: 0
+      - name: Get Version
+        id: gv
+        run: |
+          echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
+      - name: Create Release
+        uses: actions/create-release@v1
+        id: create_release
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          tag_name: "v${{ steps.gv.outputs.ver }}"
+          draft: false
+          prerelease: false
+
+  deploy-forge:
+    name: Deploy to Forge
+    runs-on: ubuntu-20.04
     steps:
-    - uses: actions/checkout@v1
-    - name: Spec Tests
-      uses: puppetlabs/action-litmus_spec@master
-      with:
-        puppet_gem_version: ${{ matrix.puppet_gem_version }}
-        check: ${{ matrix.check }}
+      - name: Checkout code
+        uses: actions/checkout@v2
+        with:
+          ref: ${{ github.ref }}
+          clean: true
+      - name: "PDK Build"
+        uses: docker://puppet/pdk:nightly
+        with:
+          args: 'build'
+      - name: "Push to Forge"
+        uses: docker://puppet/pdk:nightly
+        with:
+          args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'