diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml deleted file mode 100644 index 6208335..0000000 --- a/.github/workflows/bump-version.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Bump version - -permissions: - contents: write - pull-requests: write - packages: write - -on: - workflow_dispatch: - inputs: - bump_type: - description: 'Version bump type' - required: true - type: choice - options: - - patch - - minor - - major - - alpha - - beta - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - latest_version: ${{ steps.get-latest-version.outputs.lastest_version }} - latest_beta_version: ${{ steps.get-latest-version.outputs.lastest_beta_version }} - latest_alpha_version: ${{ steps.get-latest-version.outputs.lastest_alpha_version }} - next_version: ${{ steps.calculate-next-version.outputs.next_version }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install semver - run: npm install -g semver - - - name: Get latest version from npm - id: get-latest-version - run: | - echo "lastest_version=$(npm view @joshmiquel/memoryjs version | tr -d '\n')" >> $GITHUB_OUTPUT - echo "lastest_beta_version=$(npm view @joshmiquel/memoryjs dist-tags.beta | tr -d '\n')" >> $GITHUB_OUTPUT - echo "lastest_alpha_version=$(npm view @joshmiquel/memoryjs dist-tags.alpha | tr -d '\n')" >> $GITHUB_OUTPUT - - - name: Calculate next version with semver - id: calculate-next-version - run: | - if [[ "${{ github.event.inputs.bump_type }}" == "patch" ]]; then - echo "next_version=$(semver -i patch ${{ steps.get-latest-version.outputs.lastest_version }})" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.inputs.bump_type }}" == "minor" ]]; then - echo "next_version=$(semver -i minor ${{ steps.get-latest-version.outputs.lastest_version }})" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.inputs.bump_type }}" == "major" ]]; then - echo "next_version=$(semver -i major ${{ steps.get-latest-version.outputs.lastest_version }})" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.inputs.bump_type }}" == "beta" ]]; then - echo "next_version=$(semver -i prerelease --preid beta ${{ steps.get-latest-version.outputs.lastest_beta_version || steps.get-latest-version.outputs.lastest_version }})" >> $GITHUB_OUTPUT - elif [[ "${{ github.event.inputs.bump_type }}" == "alpha" ]]; then - echo "next_version=$(semver -i prerelease --preid alpha ${{ steps.get-latest-version.outputs.lastest_alpha_version || steps.get-latest-version.outputs.lastest_version }})" >> $GITHUB_OUTPUT - fi - - bump-package: - needs: prepare - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Create branch - run: | - branch_name="bump/v${{ needs.prepare.outputs.next_version }}" - git checkout -b $branch_name - - - name: Bump package - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - npm version ${{ inputs.bump_type }} --no-git-tag-version - git add package.json - git commit -m "chore: bump version to ${{ needs.prepare.outputs.next_version }}" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - title: "chore: bump version to v${{ needs.prepare.outputs.next_version }}" - body: | - Automated version bump to v${{ needs.prepare.outputs.next_version }} - - This PR was automatically created by the version bump workflow. - branch: bump/v${{ needs.prepare.outputs.next_version }} - base: main - labels: bump - - release-draft: - needs: [prepare, bump-package] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: GH Release - uses: softprops/action-gh-release@v2.2.1 - with: - draft: true - prerelease: ${{ inputs.bump_type == 'alpha' || inputs.bump_type == 'beta' }} - tag_name: v${{ needs.prepare.outputs.next_version }} - generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 781e445..8517a6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,32 @@ name: Release -permissions: - contents: write - packages: write - on: - release: - types: - - published - workflow_dispatch: - inputs: - checkout-branch: - description: 'The branch or tag to checkout (same as workflow if not specified)' - required: false + push: + branches: + - main -jobs: +jobs: build: strategy: fail-fast: false - runs-on: windows-2019 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.checkout-branch }} - submodules: true + persist-credentials: false - name: Setup Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.13' + + - name: Install GCC + id: install-gcc + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: build-essential@latest + version: 1.0 - name: Setup Bun uses: oven-sh/setup-bun@v2 @@ -40,40 +37,40 @@ jobs: run: bun add -g node-gyp - name: Install dependencies - run: bun install --ignore-scripts + run: bun install --ignore-scripts --frozen-lockfile - name: Build run: bun run build - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: memoryjs - path: lib/ + # - name: Upload artifact + # uses: actions/upload-artifact@v4 + # with: + # name: memoryjs + # path: lib/ - release: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.checkout-branch }} - submodules: true + # release: + # needs: [build] + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.event.inputs.checkout-branch }} + # submodules: true - - name: Download artifacts - uses: actions/download-artifact@v4.1.7 - with: - name: memoryjs - path: lib/ + # - name: Download artifacts + # uses: actions/download-artifact@v4.1.7 + # with: + # name: memoryjs + # path: lib/ - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20' - registry-url: 'https://registry.npmjs.org' - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + # - name: Setup Node + # uses: actions/setup-node@v4 + # with: + # node-version: '20' + # registry-url: 'https://registry.npmjs.org' + # env: + # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Publish release - run: npm publish --access public \ No newline at end of file + # - name: Publish release + # run: npm publish --access public \ No newline at end of file