remove chain option, update readme #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Create Tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Important: This is needed to fetch all tags | |
- name: Bump version and push tag | |
id: create_tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
RELEASE_BRANCHES: main | |
DEFAULT_BUMP: patch | |
- name: Check out new tag | |
run: | | |
echo "New tag created: ${{ steps.create_tag.outputs.tag }}" | |
- name: Save the tag | |
run: | | |
echo "${{ steps.create_tag.outputs.tag }}" > tag.txt | |
- name: Upload tag as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: tag | |
path: tag.txt | |
# test: | |
# strategy: | |
# matrix: | |
# os: [macos-latest] | |
# runs-on: ${{ matrix.os }} | |
# | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v2 | |
# | |
# - name: Setup Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: '18' | |
# | |
# - name: Cache node modules | |
# uses: actions/cache@v2 | |
# with: | |
# path: ~/.npm | |
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
# restore-keys: | | |
# ${{ runner.os }}-node- | |
# | |
# - name: Install dependencies | |
# run: npm install | |
# | |
# - name: Install type definitions | |
# run: npm install --save-dev @types/node @types/fs-extra | |
# | |
# - name: Compile TypeScript | |
# run: npx tsc | |
# | |
# - name: Lint with eslint | |
# run: npm run lint | |
# | |
# - name: Run tests | |
# run: npm run test | |
prepare-release: | |
runs-on: ubuntu-latest | |
needs: build | |
outputs: | |
new_tag: ${{ steps.set_tag.outputs.tag }} # Updated this line to use the set_tag step | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download tag artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: tag | |
- name: Set the tag | |
id: set_tag | |
run: | | |
TAG=$(cat tag.txt) | |
echo "::set-output name=tag::$TAG" | |
- name: Use computed tag | |
run: | | |
echo "Next tag will be: ${{ steps.set_tag.outputs.tag }}" # Updated this line to use the set_tag step | |
build-and-release: | |
needs: prepare-release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build with pkg | |
run: | | |
npm i | |
npx tsc | |
npm install -g pkg | |
pkg . -t node18-linux-x64 --output ./oasfi-linux | |
pkg . -t node18-macos-x64 --output ./oasfi-macos | |
pkg . -t node18-win-x64 --output ./oasfi-win.exe | |
- name: Create GitHub Release and Upload binaries/source | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.prepare-release.outputs.new_tag }} | |
files: | | |
./oasfi-linux, | |
./oasfi-macos, | |
./oasfi-win.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |