Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Check PR Title Prefix
id: title-check
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const titlePrefixes = ["feat", "fix", "breaking", "chore"];
Expand Down
171 changes: 120 additions & 51 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,133 @@
name: Publish
on:
# Note that the main branch will be used regardless of the branch chosen
# in the web interface.
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * *'
jobs:
release:
name: Packages
if: github.repository == 'AssemblyScript/assemblyscript'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: current
- name: Install dependencies
run: npm ci
- name: Build packages
run: |
VERSION=$(npx aspublish --version)
if [[ "$VERSION" == "" ]]; then
echo "Changes do not trigger a release"
elif [[ "$VERSION" != "0."* ]]; then
echo "Unexpected version: $VERSION"
exit 1
else
echo "Building version: $VERSION"
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
- uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: current
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build packages
id: build
run: |
VERSION=$(npx aspublish --version)
if [[ "$VERSION" == "" ]]; then
echo "Changes do not trigger a release"
echo "should_publish=false" >> $GITHUB_OUTPUT
elif [[ "$VERSION" != "0."* ]]; then
echo "Unexpected version: $VERSION"
exit 1
else
echo "Building version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "should_publish=true" >> $GITHUB_OUTPUT
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd lib/loader
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd ../rtrace
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
cd ../..
fi
- name: Determine npm tag
if: steps.build.outputs.should_publish == 'true'
id: npm_tag
run: |
VERSION="${{ steps.build.outputs.version }}"
if [[ "$VERSION" == *"-alpha"* ]]; then
echo "tag=alpha" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"-beta"* ]]; then
echo "tag=beta" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
elif [[ "$VERSION" == *"-rc"* ]]; then
echo "tag=rc" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "tag=latest" >> $GITHUB_OUTPUT
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Publish packages
if: steps.build.outputs.should_publish == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NPM_TAG="${{ steps.npm_tag.outputs.tag }}"
node ./scripts/prepublish
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npx aspublish --tag "$NPM_TAG"
fi
cd lib/loader
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm publish --access public --tag "$NPM_TAG"
fi
cd ../rtrace
npm version "$VERSION" --no-git-tag-version
npm run build
npm test
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm publish --access public --tag "$NPM_TAG"
fi
cd ../..
fi
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
node ./scripts/prepublish
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npx aspublish
fi
cd lib/loader
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm publish --access public
fi
cd ../rtrace
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
npm publish --access public
fi
cd ../..
node ./scripts/prepublish --reset
node ./scripts/prepublish --reset
- name: Generate changelog
if: steps.build.outputs.should_publish == 'true'
id: changelog
uses: mikepenz/release-changelog-builder-action@v6
with:
configurationJson: |
{
"categories": [
{
"title": "### Breaking Changes",
"labels": ["breaking", "breaking-change"]
},
{
"title": "### Features",
"labels": ["feature", "feat", "enhancement"]
},
{
"title": "### Bug Fixes",
"labels": ["bug", "fix", "bugfix"]
},
{
"title": "### Other Changes",
"labels": []
}
],
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}} ([##{{NUMBER}}](#{{URL}})) by @#{{AUTHOR}}",
"empty_template": "- No changes",
"tag_resolver": {
"method": "semver"
}
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
if: steps.build.outputs.should_publish == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.build.outputs.version }}
name: Release v${{ steps.build.outputs.version }}
body: ${{ steps.changelog.outputs.changelog }}
prerelease: ${{ steps.npm_tag.outputs.prerelease == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
- uses: actions/stale@v10
with:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!'
stale-issue-label: 'stale'
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: "Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: "Check that distribution files are unmodified"
if: github.event_name == 'pull_request'
run: |
Expand All @@ -29,8 +29,8 @@ jobs:
os: ["ubuntu", "macos", "windows"]
node_version: ["current", "lts/*"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
Expand All @@ -49,8 +49,8 @@ jobs:
matrix:
target: ["debug", "release"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: current
- name: Install dependencies
Expand All @@ -70,8 +70,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
- name: Install dependencies
run: npm ci --no-audit
- name: Build
Expand All @@ -86,8 +86,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: current
- name: Install dependencies
Expand All @@ -111,8 +111,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: current
- name: Install dependencies
Expand All @@ -129,8 +129,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: current
- name: Install dependencies
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

This changelog is automatically generated from merged pull requests.
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ under the licensing terms detailed in LICENSE:
* Kam Chehresa <kaz.che@gmail.com>
* Mopsgamer <79159094+Mopsgamer@users.noreply.github.com>
* EDM115 <github@edm115.dev>
* Anakun <anakun@opnet.org>

Portions of this software are derived from third-party works licensed under
the following terms:
Expand Down