Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 8 additions & 53 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
name: Release

on:
push:
pull_request:
types: [closed]
branches: ["main", "next"]
workflow_dispatch:

permissions:
contents: write
id-token: write
pull-requests: read

jobs:
release:
name: Release Amicons
if: github.ref_name == 'main'
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get PR metadata
id: pr
run: |
PR_NUMBER=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number' 2>/dev/null || true)
if [ -n "$PR_NUMBER" ]; then
TITLE=$(gh pr view "$PR_NUMBER" --json title --jq '.title')
BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body')
else
TITLE="${{ github.event.head_commit.message }}"
BODY="Automated release for commit ${{ github.sha }}."
fi

{
echo "title<<EOF"
echo "$TITLE"
echo "EOF"
echo "body<<EOF"
echo "$BODY"
echo "EOF"
} >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Get version
id: version
run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT
Expand All @@ -65,12 +42,12 @@ jobs:

- name: Write release notes
env:
BODY: ${{ steps.pr.outputs.body }}
BODY: ${{ github.event.pull_request.body }}
run: echo "$BODY" > release-notes.md
- name: Create GitHub release
run: |
gh release create v${{ steps.version.outputs.version }} \
--title "${{ steps.pr.outputs.title }}" \
--title "${{ github.event.pull_request.title }}" \
--notes-file release-notes.md \
"amicons-${{ steps.version.outputs.version }}-icons.zip#Amicons icons v${{ steps.version.outputs.version }}"
env:
Expand All @@ -81,33 +58,11 @@ jobs:

prerelease:
name: Prerelease Amicons
if: github.ref_name == 'next'
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'next'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get PR metadata
id: pr
run: |
PR_NUMBER=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number' 2>/dev/null || true)
if [ -n "$PR_NUMBER" ]; then
TITLE=$(gh pr view "$PR_NUMBER" --json title --jq '.title')
BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body')
else
TITLE="${{ github.event.head_commit.message }}"
BODY="Automated prerelease for commit ${{ github.sha }}."
fi

{
echo "title<<EOF"
echo "$TITLE"
echo "EOF"
echo "body<<EOF"
echo "$BODY"
echo "EOF"
} >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Get version
id: version
run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -139,12 +94,12 @@ jobs:

- name: Write release notes
env:
BODY: ${{ steps.pr.outputs.body }}
BODY: ${{ github.event.pull_request.body }}
run: echo "$BODY" > release-notes.md
- name: Create GitHub prerelease
run: |
gh release create ${{ steps.meta.outputs.tag }} \
--title "${{ steps.pr.outputs.title }}" \
--title "${{ github.event.pull_request.title }}" \
--prerelease \
--notes-file release-notes.md \
"amicons-${{ steps.meta.outputs.label }}-icons.zip#Amicons icons ${{ steps.meta.outputs.label }}"
Expand Down
6 changes: 3 additions & 3 deletions amicons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studio384/amicons",
"version": "1.0.0-dev.3",
"version": "1.0.0-dev.4",
"description": "The iconography.",
"keywords": [
"iconography",
Expand All @@ -9,13 +9,13 @@
],
"homepage": "https://studio384.github.io/amicons",
"bugs": {
"url": "https://github.com/studio384/amicons/issues"
"url": "https://github.com/Studio384/amicons/issues"
},
"license": "AGPL-3.0-or-later",
"author": "",
"repository": {
"type": "git",
"url": "git+https://github.com/studio384/amicons.git"
"url": "git+https://github.com/Studio384/amicons.git"
},
"files": [
"/icons",
Expand Down