Skip to content

Commit

Permalink
Add release publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kdubb committed Feb 12, 2023
1 parent aef079e commit a102899
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Publish Release

on:
push:
tags: [ "[0-9]+.[0-9]+.[0-9]+**" ]

permissions:
contents: write

concurrency:
group: publish-release-${{github.ref_name}}
cancel-in-progress: false

jobs:

build:

runs-on: macos-12

steps:
- uses: actions/checkout@v3

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer

- run: |
mkdir -p docs
mkdir -p allsgs
mkdir -p sgs
- name: Build Symbol Graph
run: |
swift build -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc allsgs
cp allsgs/Potent*.json sgs
- name: Build Docs
run: >-
swift package
--allow-writing-to-directory docs/${{ github.ref_name }}
generate-documentation
--enable-inherited-docs
--additional-symbol-graph-dir sgs
--target PotentCodables
--output-path docs/${{ github.ref_name }}
--transform-for-static-hosting
--hosting-base-path PotentCodables/${{ github.ref_name }}
- name: Archive Docs
run: tar -czf docs.tar.gz docs

- name: Upload Docs Archive
uses: actions/upload-artifact@v3
with:
name: docs-${{ github.ref_name }}
path: docs.tar.gz

publish:

runs-on: ubuntu-latest
needs: [ build ]

steps:
- uses: actions/checkout@v3

- name: Download Docs Archive
uses: actions/download-artifact@v3
with:
name: docs-${{ github.ref_name }}
path: '.'

- name: Unarchive Docs
run: tar -xvf docs.tar.gz

- name: Deploy Docs
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
clean: false

- name: Check Version Format in Tag
id: version
uses: nowsprinting/check-version-format-action@v3

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: 馃殌 v${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
prerelease: ${{ steps.version.outputs.is_stable != 'true' }}
draft: false

0 comments on commit a102899

Please sign in to comment.