Skip to content

Commit 875f7f0

Browse files
authored
Merge pull request #180 from dataplat/develop
Simplified version of Action to publish module based on tag creation
2 parents 2c96937 + c09c70c commit 875f7f0

File tree

3 files changed

+74
-5
lines changed

3 files changed

+74
-5
lines changed

.github/workflows/deploy-module.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
ref: ${{ github.head_ref }} # checkout the correct branch name
3838
fetch-depth: 0
39-
token: ${{ secrets.REPO_TOKEN }}
39+
token: ${{ secrets.GITHUB_TOKEN }}
4040
- name: Install GitVersion
4141
uses: gittools/actions/gitversion/setup@v0.9.15
4242
with:
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
ref: ${{ github.head_ref }} # checkout the correct branch name
7070
fetch-depth: 0
71-
token: ${{ secrets.REPO_TOKEN }}
71+
token: ${{ secrets.GITHUB_TOKEN }}
7272
- name: Download Build Artifact
7373
uses: actions/download-artifact@v4
7474
with:
@@ -83,8 +83,8 @@ jobs:
8383
- name: Merge main -> develop
8484
# This step merges the main branch into the develop branch after a successful deployment. This ensures that the develop branch includes the tag for the latest release.
8585
run: |
86-
git config --local user.email "jpomfret7@gmail.com"
87-
git config --local user.name "Automated Jess Did this"
86+
git config --local user.email "bot@github.com"
87+
git config --local user.name "GitHub Bot"
8888
git checkout main
8989
git pull
9090
git checkout develop
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
paths-ignore:
6+
- CHANGELOG.md
7+
- .vscode/**
8+
- .github/**
9+
- images/**
10+
- tests/**
11+
- '**.md'
12+
- '**.yml'
13+
tags:
14+
- '*'
15+
env:
16+
buildFolderName: output
17+
buildArtifactName: output
18+
19+
permissions:
20+
actions: write # to allow the workflow to run actions
21+
checks: write # to allow the workflow to create checks
22+
statuses: write # to allow the workflow to create statuses
23+
24+
name: Deploy Module (only)
25+
# This workflow is triggered on push to the main branch and deploys the module to the PowerShell Gallery and creates a GitHub Release.
26+
jobs:
27+
Build_Stage_Package_Module:
28+
name: Package Module
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Code
32+
uses: actions/checkout@v3
33+
with:
34+
ref: ${{ github.head_ref }} # checkout the triggered ref (branch or tag)
35+
fetch-depth: 0
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Build & Package Module
38+
shell: pwsh
39+
run: ./build.ps1 -ResolveDependency -tasks pack
40+
- name: Publish Build Artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: ${{ env.buildArtifactName }}
44+
path: ${{ env.buildFolderName }}/
45+
46+
Deploy_Stage_Deploy_Module:
47+
name: Deploy Module
48+
runs-on: ubuntu-latest
49+
needs:
50+
- Build_Stage_Package_Module
51+
if: ${{ success() && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
52+
steps:
53+
- name: Checkout Code
54+
uses: actions/checkout@v3
55+
with:
56+
ref: ${{ github.head_ref }} # checkout the triggered ref (branch or tag)
57+
fetch-depth: 0
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
- name: Download Build Artifact
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: ${{ env.buildArtifactName }}
63+
path: ${{ env.buildFolderName }}
64+
- name: Publish Release
65+
shell: pwsh
66+
run: ./build.ps1 -tasks publish
67+
env:
68+
GitHubToken: ${{ secrets.GitHubToken }}
69+
GalleryApiToken: ${{ secrets.GalleryApiToken }}

source/FabricTools.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'FabricTools.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.0.1'
15+
ModuleVersion = '0.31.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

0 commit comments

Comments
 (0)